CP (class points), called JP (job points) in Japanese, is used to unlock classes. Aside from Fighter, Knight, Priest, and Wizard, all classes require some amount of CP to unlock, in addition to various other prerequisites. CP can also be traded for EMP at a rate of 50 CP to 1 EMP.
Whenever a rank is gained, you earn 30 CP. Events will also often have CP in small amounts as rewards. Aside from that, the main way to obtain CP is from the Trade Moons shop. Bronze Moons trade for 100 CP each, Silver Moons 250 CP each, and Gold Moons 2500 CP each.