Even if you use an online service such as Gmail exclusively to manage your emails, you may want to back up your emails regularly to a local storage device.
The reason here is that you do not have control at all over your emails. There are many situations where this can be problematic: Google could close down Gmail, you may not have access to the Internet, emails may get deleted by a server failure or hacker attack.
Gmail Backup is a free program for the Windows operating system that you can use to run regular backup jobs so that all messages on Gmail get saved to the local system the software is running on.
Gmail Backup will backup all Gmail mail folders and mails they contain, including labels, dates and from fields.
Before the backup can be started users have to enable IMAP in the Gmail settings. Once that nuisance is out of the way it is possible to backup all Gmail messages with minimal interaction. If desired a time interval can be set to restore only emails of a certain period and not all of them.
Please note that you need to add your Gmail login address and password to the program to use it.
Interestingly enough emails will be stored in Microsoft's eml format which makes it easy to import the messages into other mail clients. Gmail Backup provides a restore option to restore previously backed up emails; Not necessarily though to the same user account since the name and password of the user account can be specified freely whenever Gmail Backup is being used.
An alternative to using Gmail Backup is to configure a regular email software client like Mozilla Thunderbird or Microsoft Outlook to retrieve messages from Gmail. There is no restore option though for those messages, but you could forward them again to your mail address or resend them without forwarding.
The advantage is however that you may not have concerns adding your Gmail account to those programs.
Update: Gmail Backup has not been updated since 2009 which makes it likely that it won't work properly anymore. The developer has released it as open source licensed under GNU GPL v3 so that it is theoretically possible that someone else forks it now. Since it is open source now, it is also possible to audit the code of the program.
A far better solution nowadays however is the excellent MailStore Home software. It is a free program that you can use to backup Gmail emails, and emails from a lot of other providers and desktop applications.
When it comes to Gmail, all you need to do is select the Google Mail service from the available options, and enter your email address and password to get started. MailStore home will download all emails to the local PC so that you have them available backed up safely. The program comes with options to search the emails, or to import the emails back into a desktop application if you prefer that.