Nitrogen has five valence electrons. This can be determined by counting the number of elements (from the left) on the periodic table. Nitrogen is the fifth from the left on the periodic table, thus it has five valence electrons.

Nitrogen electron shells

Nitrogen electron shells
source: Greg Robson, cc-by-sa, via Wikimedia Commons

This method only works for the first, second, and third period. Once you get to the fourth period, the d-block elements come into play.

If you’re looking for the valence electrons in a p-block element in the fourth period, though, just skip over the d-block.

Another way to find valence electrons for other elements is by remembering that ALL elements in the same column as Nitrogen have five valence electrons.