Here the 4 is total number of hydrogen atoms. In NH4+, there are 1 nitrogen, 3 hydrogen and 1H+. So in total there are 1 nitrogen and 4 hydrogen.
Of the 8 valence electrons in the NH3 molecule, 3 pairs are being shared in an N-H bond and the fourth pair is held on the Nitrogen atom exclusively. That "lone pair" of electrons is attracted to H+ (which is really just a proton) due to electrostatic attraction of negative & positive charges, and essentially the H+ is able to pull on that pair of electrons enough to form a new bond. The overall charge of the system doesn't change (NH3 + H+ -> NH4+)
So the 4 in your doubt represent total number of hydrogen atom( both H and H+)