How is the number of electrons in an atom found? I was wondering, what type of experiments were held to identify the number of electrons in an atom?
(For example, how do we say that carbon has 6 electrons and magnesium 12.) I would like someone to give me a link to a video of this experiment in comment form or answer form, because it would be more clear me if I saw the experiment rather if someone explained it to me.
 A: There is no such experiment, though there are lots of experiments where the number of electrons in an atom are measured as a side effect.
We know atoms are electrically neutral so there must be equal numbers of electrons and protons. We know successive elements in the periodic table are built up by incrementing the number of protons, so we know how many electrons the atoms must have. So, for example, we know the carbon atom has six protons, therefore it must have six electrons.
Arguably this just moves the problem back one step. The question would then be how we know the carbon atom has six protons. These days it's dead easy as we just measure the mass of the carbon nucleus very accurately and because we know the proton and neutron masses we can tell how many protons and neutrons it contains. Historically the atomic number was obtained largely by deduction rather than direct measurement.
I did say there were experiments that measure the number of electrons as a side effect. For lots of years collider experiments have been done with atomic nuclei. This is currently done at RHIC and the LHC ALICE experiment, but it was being done long before. The atoms have their electrons stripped by being fired through a carbon film, and their nuclear charge is then measured as a side effect of accelerating them. For a carbon nucleus we measure a charge of $+6$, therefore a neutral carbon atom must have six electrons.
A: As John Rennie answered it very clearly, I would like to add some more details too.
See, around early 1900 the idea of atoms was floating around the scientists' heads. At first everything was theory, but these things happened:


*

*You certainly heard of Joseph Thomson's cathode rays. Well, he actually calculated the ratio Q/m of atoms. (You can search any of the experiments in Google.)

*The famous Robert A. Millikan created an experiment named oil drop experiment. He found out the charge of an electron. Therefore, using Thomson's ratio, he found out the mass of an electron!

*Then the famous Rutherford gold foil experiment were done. With this experiment Rutherford and his team found out the mass of an atom and a nucleus.
After that so many things happened. Very fast. With the mass of an electron and the idea of an atom consisting of nuclei and its charge is neutral then you can easily find out about the amount of atoms by measuring the mass of an object! Rutherford's team actually estimated the amount of atoms. John Rennie answered the rest very well.
