I am not understanding,why do we have to subtract the charge from the atomic number while finding the number of electrons.
Suppose an atom of element 'X'
Let's assume the charge on this atom is 0 - hence, the number of protons in the nucleus and the number of electrons revolving about the nucleus must be equal, which results in a net 0 charge on the atom.
Now, lets assume that another atom of 'X' has +1 charge over it. Well, how could this happen? There are two ways for this to happen.
1) Nucleus gains an addition proton (+1 charge)
2) Atom loses an electron(-(-1) charge)
Both of these cases result in the atom gaining +1 charge.
Case 1 is very difficult to achieve, hence its not a good idea to think about in any chemical reaction (in fact it is not one at all, see comments!), instead consider case 2.
Notice, losing an electron results in +1 charge over the atom - another way to think of this is that we have ruined the balance that existed between the number of electrons and number of protons.
So we could say the above sentence in your words, we subtract the total charge present on the atom from the atomic number (remember, originally when the atom had no net charge, atomic number = number of protons = number of electrons. This is no more the case now!) to get the number of electrons present in the atom.
This is a very basic form of conservation of charge.