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.