You need to turn on IMAP in your settings. We recommend reading this article before continuing:

https://support.google.com/mail/troubleshooter/1668960?hl=en

The server settings you need to know after this are:

  • Incoming Mail (IMAP) Server – Requires SSL
    • imap.gmail.com
    • Port: 993
    • Requires SSL:Yes
  • Email address: your full Gmail address (username@gmail.com)
    Google Apps users, please enter username@your_domain.com
  • Password: your Gmail password

You will also need to make sure the setting for less secure apps is turned on, this is also needed for applications like Outlook or Thunderbird.

https://support.google.com/accounts/answer/6010255?hl=en