How to Log Out of the iTunes Store on an iPhone
When giving your iPhone to someone else or selling it, you'll want to make sure that your personal data no longer exists on the device. You'll also want to sign out of your iTunes account to ensure that the phone's next owner can't make iTunes or App Store purchases using your payment information. Signing out of an iTunes account on the iPhone can be done in just a few steps.
Tap on the "Settings" icon located on your Home screen.
Select "Store" from the list of menu options on the page.
Choose the "Sign Out" button located with your account information. This will sign your iPhone off of your iTunes account and will prevent purchases from being made in either the iTunes Store or the App Store.