When syncing or downloading your messages from your Gmail account doesn't work, just follow this recommended settings on your Apple Mail:
From the
Mail menu, click
Preferences >
Accounts >
Mailbox Behaviors
Drafts:
Store draft messages on the server >
do NOT check
Sent:
Store sent messages on the server >
do NOT check
Junk:
Store junk messages on the server >
checked
Delete junk messages when >
Never
Trash:
Move deleted messages to the Trash mailbox >
do NOT check
Store deleted messages on the server >
do NOT check
That's it!