The center of mass is the center found by using the mass density distribution over the region occupied by the body.
It is found by average of distance of mass elements weighted by the distance of the mass element from a fixed point on the body or reference frame. It is fixed for a body. It depends on shape of the body and its density.
Center of gravity is related to the gravitational field in which the body is present. Suppose the body is present in a uniform gravitational field, the gravitational forces acting on small mass elements will have no net torque about the center of mass CM. Hence, the center of gravity will be same as center of mass.
If the gravitational field strength is different in different regions of the body, the there will be a different point on the body, about which the net torque due to gravitational forces on mass elements will be zero. Then center of gravity is different from CM.
In general, on Earth - for various objects which are rigid, the center of mass and center of gravity are same. This is because g is assumed to be same and uniform at a location over a large region.