From the knowledge base:
Remember to deauthorize your computer before you sell or give it away. To deauthorize a computer:
1. Open iTunes.
2. From the Advanced menu, choose Deauthorize Computer.
3. Select "Deauthorize Computer for Apple Account" and enter your Apple ID and password.