One way is to log in using a mail client that supports IMAP. You can then export the emails to a backup location, but this is a bit laborious.

If you want a continuous backup, you could try something like imapsync. This would require you to run your own backup IMAP server and schedule a regular task to perform the synchronisation.

Edit: Preserving labels should work fine, but not quite in the way that Gmail handles them. I've not seen any IMAP or POP3 servers which handle the Gmail label system properly. Gmail presents each tag as a separate folder through IMAP, so as far as the user is concerned, the message exists in several places. (In fact, the inbox is just another label). If you synchronise your account to another IMAP server, you will essentially have multiple copies of the same message.

Here's one more backup solution from the comments to that Engadget post:

I have all my GMail emails forwarded to my Hotmail account, of which all of the emails are downloaded locally on 2 different computers. I've had my Hotmail account since 1998, and I've never lost anything or had a problem so if GMail goes down, Hotmail will still work, and if that goes down, I have it all backed up.

Hopefully with this bump, we'll get even more good, up-to-date answers to the question. (At least gmail-backup.com, mentioned in the accepted answer, now seems defunct.)

I'm kind of find of IMAPSize. It's not the most fully-featured tool you'll ever find, but it backs things up in the most open way possible: each message in it's own file, which could easily be imported into any other e-mail client. It also includes an option for restoring from a backup (though I've never tested that).

Be careful when using IMAP mail clients for backups: I lost some mail at one point because I had thought Thunderbird was keeping local copies of things that it had decided it didn't need to keep. This was a config error on my part, but it's a warning to be careful.

While this may guard against certain failures (one's own mistakes), it may not guard against others. File under "Do not put all your eggs in one basket." ;-)
–
Chris W. ReaFeb 28 '11 at 14:45

1

Its helpful if your gmail account is filling up and you want to split your mails in two accounts to have more space. So more like "put your eggs in two baskets of equal size but joined together, at least you can put more eggs" :-)
–
YasserFeb 28 '11 at 15:58

I developed Gmail Keeper for this. Why I've done that when there are other tools out there? Because I need to backup multiple Gmail accounts on a regular basis, and I don't want to input the login info each time when I need to make a backup.

Both emails and labels will be backed up to local disk in standard file formats (eml and zip). It can also backup the Gmail chat logs if you enable the 'Chats' folder access in the advance IMAP settings in Gmail. However, It's for Windows only.