To stop iTunes from opening when you put a CD in, you need to open the Settings or Preferences panel first. Then, find the When a CD is inserted option in the CDs & DVDs section. From here, you need to choose the Ask to Import CD option. If you select the Play CD or Show CD option, it will open automatically.