Go to your Gmail account on Googles site and make sure it is enabled for IMAP as follows:
- Sign in to Gmail.
- Click the gear in the top right.
- Select Settings.
- Click Forwarding and POP/IMAP.
- Select Enable IMAP.
- Click Save Changes.
Wait 15 minutes or so for the changes to be applied. Then on your Mac, open Mail, go to Mail>Preferences>Accounts, click your Gmail POP account on the left, then uncheck Enable This Account to the right. Then click "+" below the accounts list, select Google and add your Gmail account. It should be added as an IMAP account this time. (You can check Mail>Preferences>Accounts>your Gmail account>Account Information to be sure the Incoming server says "imap.gmail.com".)
On your iOS device(s), deleting the existing account in Settings>Mail,Contacts,Calendars then add it back by tapping Add Account>Google.