One of the iPhone’s tricks is the ability to keep an always up-to-date backup of your info, apps, settings and personal preferences in the cloud. If you switch phones or buy an iPad, log in and all your info comes with you. To set up iCloud backup:
Go to Settings > iCloud > Storage & Backup
Under iCloud Backup, slide the switch to On
Your phone will back up to the cloud any time it’s on, locked, connected to a power source and connected to the internet via Wi-Fi.
To restore your phone from a backup, choose Restore from iCloud Backup on the initial setup screen and enter your Apple ID and password.