In the carbonate anion, which atoms gain the two electrons?
One can draw Lewis structures to see where the lone pairs of electrons may be.

Here you can see that you can draw the ion like this, with one of the oxygen atoms having a double bond with the carbon, and the other two having a single bond. This means that the double bonded oxygen atom has no charge. The single bonded oxygen atoms have a net charge of $-1$ each as they have gained a lone pair of electrons.
However this picture does not tell the whole story. In reality, the negative charges are not localised to individual oxygen atoms in the ion. We can draw a total of three structures (called canonical forms):

These can be drawn because in actual fact there is delocalisation of electrons between the carbon and each oxygen atom. The true structure is not changing/oscillating between these three forms, but is actually called a resonance hybrid of all of the canonical forms. This is shown below. Therefore you can see that the negative charges are not localised to single oxygen atoms, but are instead delocalised across the entire ion.

If you want to read more about the carbonate ion and its structure: https://en.wikipedia.org/wiki/Carbonate#Structure_and_bonding