In short
Valence electrons are the electrons in the outermost shell of an atom. They decide how the atom bonds and how it reacts.
For a main-group element, the number of valence electrons is the group number (for groups 1 and 2) or the group number minus (for groups 13 to 18). Atoms tend to gain, lose or share electrons until they have a full outer shell, usually 8 electrons, the octet rule. Helium is the exception, with 2. The outer shell is also called the valence shell.
Chlorine has the configuration , so it has 7 valence electrons. It needs 1 more to reach an octet, so it forms the ion or shares one pair of electrons.
Also searched as: outer valence shell, valence shell numbers, shells atoms.