The position of an element in the periodic table tells you its electronic configuration. Elements in the same vertical column, called a group, have the same number of electrons in their outer shell. The group number is the number of outer electrons, so Group 1 elements have one outer electron and Group 7 elements have seven. The noble gases in Group 0 have full outer shells (helium has 2 and the others have 8), which makes them very unreactive.
Elements in the same group have the same number of outer electrons, so they have similar chemical properties. The horizontal rows are called periods. The period number is the number of occupied electron shells.
Sodium (2.8.1) has three shells and one outer electron, so it is in Period 3 and Group 1. Chlorine (2.8.7) is in Period 3 and Group 7. Calcium (2.8.8.2) has four shells and two outer electrons, so it is in Period 4 and Group 2. Oxygen (2.6) is in Period 2 and Group 6. Across a period, each element has one more outer electron than the one before it.