Logging out of your iTunes account will prevent other users from making purchases on the Apple store using your personal Apple ID. You can perform the 'logout' procedure from either a computer or an iOS device.
Steps
Method 1 of 3: Log Out While Viewing iTunes Library

Step 1. Log into the open iTunes session on your computer

Step 2. Select the 'Store' menu located on the iTunes menu bar

Step 3. Select the 'Exit' item
ITunes will no longer be connected to your Apple ID.
Method 2 of 3: Log Out of iTunes While Viewing the Store

Step 1. Log into the open iTunes session on your computer

Step 2. Select the 'iTunes Store' button located in the upper right corner of the iTunes window

Step 3. Select the 'Exit' item located in the upper left corner of the window
ITunes will no longer be connected to your Apple ID.
Method 3 of 3: Log out of iTunes from iOS device

Step 1. Select the 'Settings' icon of your iOS device

Step 2. Select the 'iTunes Store and App Store' item

Step 3. Select the Apple ID connected with the device and currently connected to iTunes

Step 4. Select the 'Exit' item
ITunes will no longer be connected to your Apple ID.