As you move from left to right across the periodic table, the number of valence electrons in an atom increases.
Elements in the same group (column) have the same number of valence electrons, but as you move from one group to the next (from left to right), the number of valence electrons increases by 1 for each successive group. For example, alkali metals (Group 1) have 1 valence electron, alkaline earth metals (Group 2) have 2, and so on, until the noble gases (Group 18) which have 8 valence electrons (except for helium, which has 2).