The center of mass is a position defined relative to an object or system of objects. It is the average position of all the parts of the system, weighted according to their masses.
For simple rigid objects with uniform density, the center of mass is located at the centroid. For example, the center of mass of a uniform disc shape would be at its center. Sometimes the center of mass doesn't fall anywhere on the object. The center of mass of a ring, for example, is located at its center, where there isn't any material.
The center of gravity is the point through which the force of gravity acts on an object or system. In most mechanics problems the gravitational field is assumed to be uniform. The center of gravity is then in exactly the same position as the center of mass. The terms center of gravity and center of mass tend to often be used interchangeably since they are often at the same location.