You can transfer iTunes purchases, but for non iTunes purchases, you need to use a third party utility.
Connect the iPhone to your computer.
Launch iTunes. Select the iPhone under Devices left side of the iTunes window.
Now from the iTunees menu bar top of your screen click File > Transfer Purchases from ..
For non iTunes purchases, see Zevoneer's post here > Moving files from Ipod to Itunes: Apple Support Communities