You first need to have installed iTunes on your computer then plug your iPhone to your computer and run the iTunes program. Once connected, click on preferences then under it select the option transfer purchases which will pull all the songs from iTunes and applications from the iPhone to the computer.
Why not try the Coolmuster iPad iPhone iPod to Computer Transfer to help you transfer your iPhone music to your laotop? It is very easy to use, and also can help you transfer videos, music, photos, etc. on your iPad iPhone or iPod to computer for backup. Get it here: http://x.co/42va2