Make a backup using iTunes: If your old device is running iOS 4 or earlier, an iTunes backup is the way to go. To update your backup (or to create a new one) connect your old device to the computer you normally sync it with via USB, open iTunes, select the device, and press the Sync button. You can also create a backup by control-clicking on the device in the iTunes Source List and selecting Back Up from the drop-down menu.
Make a backup using iCloud: If you're running iOS 5 or iOS 6 on your old device and you have an iCloud account, you can alternatively take advantage of iCloud Backups to save your data. Your device will automatically make an iCloud backup once a day while locked, plugged in, and connected to a Wi-Fi network, but you can manually force a backup whenever you're on Wi-Fi by opening the Settings app on your device. Navigate to iCloud > Storage & Backup, and make sure the iCloud Backup switch is toggled on. From there, you just have to tap on Back Up Now to start the process. (You should note that iCloud backups can sometimes take significantly longer than iTunes backups, so it may not be the best option if you're in a hurry to set up your new phone.)
Upgrade from another smartphone
Moving from an Android, BlackBerry, or Windows smartphone to the iPhone 5? Depending on how you've set your information up, it should be relatively painless to transfer it to your new device.
Mail, contacts, and calendars: If you're using a Gmail account or other POP or IMAP-based account for mail on your smartphone, it's already syncing to a central server, and you should be able to add that account to your new iPhone with few issues. Apple's iOS has automatic setup for those using Microsoft Exchange, Gmail, Yahoo, Aol, or Hotmail; you'll also be able to manually set up a POP or IMAP account for mail, LDAP or CardDAV for contacts, or CalDAV for calendars. You can alternatively use Apple's free iCloud service to set up a new email account.