If your email address doesn't end in @gmail.com, make sure you put @gmail.com as the end of your email address in the new account wizard so Opera Mail picks the right settings for Gmail. Use the correct email address in the username field though.

After the account is set up, you can edit the address on the general tab in the account's properties.

So, delete the "mail" folder (see "Menu -> help -> about Opera Mail" for the location) while Opera is closed, start Opera back up and add the account in fresh (use IMAP).

Besides that, do you use 2-step verification for your google account? Maybe it has something to do with that. Opera doesn't support oAuth, so that might be the issue.

Besides that, if you have an antivirus email scanner, turn the email scanner off to see if it helps.