In the periodic table of the elements, a period is a row of the table.

The number of electron shells an atom has determines what period it belongs to. Each shell is divided into different subshells, which as atomic number increases are filled in roughly this order:

1s  
2s           2p  
3s           3p  
4s        3d 4p  
5s        4d 5p  
6s     4f 5d 6p  
7s     5f 6d 7p  
8s  5g 6f 7d 8p  
...  

Hence the structure of the periodic table. Since the outermost electrons determine chemical properties, those tend to be similar within periodic table groups.

Elements adjacent to one another within a group have similar physical properties, despite their significant differences in mass. Elements adjacent to one another within a period have similar mass but different properties.

See also: