These damages combined make up the sum of a judgment.
Compensatory damages are meant to account for the plaintiff's troubles and can include medical bills, legal fees, pain and suffering, and other such things where the aim is to properly compensate the plaintiff for the different aspects of their ordeal.
Punitive damages, on the other hand, are simply meant to reform or deter the defendant from similar action. They are damages meant to punish a defendant for eggregious breaches of contract or law and are often used to set examples for other companies or individuals who might operate similarly to the defendant. However, punitive damages are awarded sparingly and most judgments consist only of compensatory damages.