In an atom, the electrons found in the outermost energy level are called valence electrons and these participate in chemical reactions between atoms. The atomic number of an atom indicates the number of protons it has in the nucleus. In a neutral atom, there will be an equivalent number of electrons orbiting around the nucleus.
Sodium has an atomic number of 11. This means means there are 11 protons in the nucleus and 11 electrons in orbitals around the nucleus. The first energy level can hold 2 electrons, the next can hold 8. Therefore, the third energy level has 1 electron which is the valence electron.
Magnesium has an atomic number of 12. Following the logic used in the previous example, there would be 2 valence electrons in the third energy level.
Aluminum has an atomic number of 13 and would have 3 valence electrons.
Chlorine has an atomic number of 17. It has 7 valence electrons.
Oxygen has an atomic number of 8. It has 6 valence electrons.
Nitrogen has an atomic number of 7. It has 5 valence electrons.
An easier way to find valence electrons is by looking at the main group numbers in the periodic table. For example, oxygen is in group 6 and it has 6 valence electrons. The second link shows the main groups of atoms and their valence electrons.