Protons: 12
Neutrons: 12
Electrons: 12
The atomic number of Magnesium is 12, so it has to have 12 protons. The atomic mass of Magnesium is 24, so it has to have 12 neutrons since 12+12=24 (electrons don't have weight). You can tell it has 12 electrons because the electrons are always the same number as the protons.