Magnesium, in its elemental form, has 12 protons and 12 electrons.
The neutrons are a different matter. Magesium's average atomic mass
is 24.305 atomic mass units, but no magnesium atom has exactly this
mass.
Atomic masses like the one quoted above are found by taking an
average of the masses of each isotope, weighted based on how much of
each is present in nature.
An isotope is a compound with the same number of protons and electrons, but different number of neutrons.
The three most natural isotopes of Mg are Mg-24, Mg-25, and Mg-26.
Mg-24 (12 neurtrons) is 78.9%, Mg-25 (13 neutrons) is 10% and Mg-26
(14 neutrons) is 11.01%, of all the Magnesium found in nature. There
are also synthetic isotopes, created as byproducts of nuclear decay or
intentionally for commercial use, so they aren't included.
So you might account for this isotope problem by saying that about
79% of all Magnesium atoms have 12 neutrons, 12 protons, and 12
electrons.
For further research, I suggest you use the source I used to obtain this information (available at your local library):
Heiserman, David. "Exploring Chemical Elements and Their Compounds". Copyright 1992. Tab-Books/McGraw Hill P.49 - 53
Jason
(published on 10/22/2007)