Apple uses iTunes and the backups you make of your iPhone to both restore backup data to a phone and transfer data between devices. If you purchase a new iPhone and you want to transfer the apps and data from your old iPhone, you will use the iTunes backup and restore processes to facilitate this. You simply perform a backup of your old iPhone and restore that backup to your new iPhone. The iTunes and iPhone software do the heavy lifting. It is even possible to back up an iPhone and restore the data to an iPod Touch in this manner.
Connect your old iPhone to your computer using the USB cable that connects to the phone.
Open iTunes and select your iPhone name in the left column and press the sync button in the lower right corner of iTunes. You should see a notification in the middle window at the top of iTunes that indicates the old phone is being backed up. You can ensure that it is backed up, if you right-click (or control-click on a Mac) on the iPhone name in the left column of iTunes and select "Back Up" from the pop-up menu.
Disconnect your old iPhone and connect your new iPhone to your computer using the USB cable that came with it. You may be able to use the same USB cable, but best to use the cable that came with the new iPhone.
Locate the icon and name of the new iPhone in the left column of iTunes and right-click (or control-click on a Mac) on it. This will pop up a menu, and you will need to select the option to "Restore from Backup."
Choose a backup to restore. There should be a backup with the name of your old iPhone and a date and time that correspond with the backup you just performed.
Wait for the backup of your old iPhone to fully restore to your new iPhone. When the restoration process is complete, you will have all apps and data from your old iPhone on your new iPhone.