Groups and periods are just ways to divide and categorise elements in the periodic table according to their properties- be it physical or chemical. A period is the horizontal line and all the elements in one period have the same number of energy levels. A group is the vertical line and all the elements in a group have the same number of electrons in the outer most energy level- hence why they have similar chemical properties as the electrons on the outer shell dictate reactability.