For purchased music off the iTunes Store
Connect your iPhone, run iTunes wait for your iPhone to show up, right-click on the iPhone icon and click on
Transfer purchases.
You can also enable Automatic Downloads for Music, Apps, and Books from your iPhone by going to Settings > Store and toggling the slide next to Music to ON.
Don't forget to log-in to your iTunes Store account using your Apple ID and password within iTunes on your computer.
Transferring non-purchased music from iPhone to iTunes
Most of the non-purchased songs on your iPhone should already be stored somewhere on your PC. If that is not the case, use one of many non Apple utilities to transfer. Here is a list of ten apps each of which could be useful for
transferring non-purchased iPhone music to iTunes.
If you have your iPhone non-purchased music tracks loaded somewhere on an external disk, you can easily import the tracks from that location to straight to your iTunes library by following this Apple guide:
Adding music and other content to iTunes
Finally, you can use Apple's paid service called iTunes Match to upload any tracks you might have stored away somewhere on a dusty hard disk and stream them on both your iPhone and iTunes on your computer. More about the iTunes Match service [URL="https://www.apple.com/itunes/#mn_p]here[/URL].