After connecting your iPhone to the computer and its icon appears in iTunes, you can choose
Transfer Purchases from iPod from the
File menu.
Or you can right-click (Windows or Mac) or Control-click (Mac only) your iPhone in the iTunes Source list, then choose
Transfer Purchases from the shortcut menu that appears.
Please note that this feature only works for items that were purchased on the iTunes Store. Any items imported from audio CDs or acquired from other sources will not copy from your iPod or iPhone to the iTunes library.
Hope that helps you out.