why nh3 is not an ion while nh4 is a ion?
Basically what happens is that nitrogen has 6 protons in the nucleus, hence as a free atom 6 electrons for neutrality.
In ammonia there are 10 electrons shared between the nitrogen and the hydrogens (which have one proton each) hence totally 10 protons versus 10 electrons, making ammonia neutral overall.
Of course Nitrogen also wants to complete the octet, i.e. have 8 electrons in the highest shell, which is basically filling all it’s energy states of that shell.
In ammonia it does that by having a free lone pair (ie two paired electrons which do not participate in the bonding of the molecule).
In Ammnoium you still have 10 electrons but one extra proton (due to the 4th hydrogen), hence you have 11 protons, making ammonium +1.
Note that Nitrogen CANNOT accept any more electrons in that shell (there are no other free states), hence it can only share it’s lone pair with an hydrogen nucleus (coming from HCl in this case)