Valence electron is the generally the electron which is associated with an atom that can participate in the formation of chemical bond. For simple molecules, it is the outer most electron shell.
Looking at the periodic table, the group number can be regarded as the valence electron for each atom. Let me show you an example:
Hydrogen = 1
Helium = 2
Lithium = 3
Oxygen = 6
Beryllium, being in the second group under the alkali earth metals, its valence electrons is 2. Generally, two electrons of Beryllium atom can participate in the chemical reaction.