Same thing happened to me. All was fine until a couple of days ago when the home computer (Snow Leopard) stopped syncing IMAP Gmail, though I could send. And yesterday, my iPhone stopped syncing IMAP Gmail. After resetting and reconfirming server names and passwords, I found this thread and the Gmail 'known issues' page. Apparently Google is working with Apple on this.
http://mail.google.com/support/bin/static.py?page=knownissues.cs&kitopic=14973&issue=163171&bucket=14977&hl=en&action=report
"My account has been locked out for exceeding IMAP bandwidth limits when using Apple Mail on the Snow Leopard OS
This is a known issue for users of Apple Mail on the Snow Leopard OS. We are working with Apple on a resolution to the issue. In the meantime, there are a few workarounds to reduce the likelihood of hitting the bandwidth limit:
1. Do not sync attachments.
2. Reduce the number of folders you sync by using the Advanced IMAP Controls lab in Gmail.
3. Close your email client when you are not using it."