Mutt seems to sync to Gmail IMAP only on quit

Manual syncing

Try $:

$         sync-mailbox         save changes to mailbox

Automatic syncing?

You can't make mutt do that automatically/periodically, by design. The reasoning, as I understand it, is that it might lead to data loss. E.g., when you mark something as deleted, you'd normally be able to undo, and auto-syncing would interfere with that (see Re: Auto sync-mailbox - no way! and Mutt, IMAP and auto'refresh').

Mailboxes should be synced in any case when you change folders/mailboxes.

Alternatives

There's a source patch adding a timeout-hook to mutt you could use to periodically call sync-mailbox, but it's for mutt 1.5.9 and I don't know if it can be applied against the current version.

You could also set up OfflineIMAP (or isync). It's designed for synchronizing local mailbox(es) with a central IMAP one. You can then use another notification system (like e.g. mutt's built-in one or mail-notification etc.) to watch your local box for changes.