Nomenclature of inorganic compounds
Nitrogen can have a variety of oxidation states ranging from -3 to +5. For example:


  -3


The nitrogen atom in ammonia $\ce{NH3}$ has an oxidation state of -3 (each hydrogen is +1).


  -2  


The nitrogen atoms in hydrazine $\ce{N2H4}$ has an oxidation state of -2.


  0


The oxidation state of the nitrogen atoms in $\ce{N2}$ is 0.


  Nitrate and nitrite


The nitrogen atom in the nitrate ion $\ce{NO3-}$ has an oxidation state of +5. Each oxygen atom has an oxidation state of -2, and the overall charge on the ion is -1. 

The nitrogen atom in nitrite ion $\ce{NO2-}$ has an oxidation state of +3.

Nitrogen can have such a range of oxidation states because of its electron configuration, which is $\ce{[He]}2s^2 2p^3$ (5 valence electrons). Nitrogen can "gain" up to three electrons or "lose" up to five electrons.