This question can be answered in a number of ways depending on which type of object you are talking about, whether it is a two-dimensional shape (like the usual stuff we see), or a 3dimensional shape (a shape with has space within separating each of its faces).
First, let's establish what is a center of gravity: This is the point at which we can determine where within the shape it shifts in order to be able to maintain balance in its own balance. It is also the point of weight in which the object sustains movement, as well as the place in which this point of weight is located. This is a property of all geometric shapes.
The easiest way to figure out its point of weight is by rotating it to see where the object tends to deposit its balance.
For example, if you take a paper shape and you divide it using a line of symmetry, the center at which the shape will meet the line of symmetry would be its center of gravity. If you place a pen on that same spot and rotate the paper shape, if the paper is able to rotate without obstacle, then you have hit the center of gravity of that object.
It sounds a bit complicated but it gets even more complicated with 3D shapes. Read the article included in the answer so that you can see that there are some specific formulas to determine the CG of an object based on direct observation and direct measurement.