Here how to set up Google's outgoing mail (SMTP) server from Google Help. The error shows that you're trying to connect to port 25, and that's the wrong setting.
The first step is to sign in at gmail.com, and check that IMAP is turned on for your account. Sign out of gmail.
Follow the instructions to set the Mail Settings preferences in Mathematica. Enter your password at the Incoming tab.
Added: Google IMAP limits and troubleshooting
As of May 2020, Google limits accounts to 2500 MB per day for IMAP downloads and 500 MB per day for IMAP uploads. Exceeding these limits may cause a temporarily lockout.
There’s a limit of 15 IMAP connections per account. If you use multiple email clients or devices for the same Gmail account, try closing or signing out of some.
The Google Help troubleshooting notes that email applications may try to download too many emails at one time, and recommends:
- Update Gmail IMAP settings so you don't sync certain folders.
- In Gmail IMAP settings, set IMAP to only sync folders with 10,000 emails or fewer.
- Make sure your mail application isn't set to check for new email too frequently. If your mail application checks for new messages more than once every 10 minutes, access to your account could be blocked.
Mathematica doesn't seem to have an preference setting to limit IMAP downloads. Large gmail folders could exceed the daily download limit.