The iPhone is not only a mobile device that can play music, videos and podcasts; it can download music from the iTunes Store application and copy the file to your computer by syncing to it using the iPhone's USB cable. (As of 2010, Apple will only allow you to transfer music from your device to your computer if the tunes are purchased content (as opposed to being ripped from a file-sharing site) in order to prevent illegal music sharing.
Video of the Day
Plug the USB cable into the iPhone's dock connector located at the bottom of the device. Connect the other end into a USB port on your computer.
Open the "Applications" folder in "Finder." Double-click the "iTunes" icon, if you are using a Macintosh computer. Or select "Start," "All Programs," "Apple" and "iTunes" if you are on a PC.
Click "File" at the top of the menu. Select "Transfer Purchases from (Username)'s iPhone" from the drop-down menu.
Wait for the "iPhone sync to complete the process. Unplug the iPhone only after the "OK to Disconnect" message is displayed.