One of the nicest things about IMAP in Gmail—which can download and upload messages to the server, versus POP's download-only—is that you can drag and drop folders of messages into Gmail using any IMAP client. Over at the Draconis Software blog, reader Ryan had about 10,000 messages in Apple Mail he wanted to store in Gmail. He writes:
It was simple: I merely added Gmail as an IMAP account to my Apple Mail client, then just dragged folder-by-folder all the messages important to me onto my Gmail account. It took a while to transfer all the messages (be sure to open the Activity window in Mail to see your progress), but once it was done, all my old messages were safely stored in Gmail and had their original dates! Perfect!
Unlike pre-IMAP methods of importing messages, like Ryan says, using IMAP will preserve the messages' original dates. If you're not using Apple Mail, check out how to turn Thunderbird into the ultimate Gmail IMAP client.