Open iTunes > Store > Authorize this Computer
Enter the information to authorize that computer. Secondly, I put all my stuff from iTunes onto my iPhone, then I plugged it in to the new computer and right clicked "iPhone" or whatever the device name is, and click transfer purchases.