The number of elements in a period is determined by the number of electrons that can be accommodated in the outermost s and p subshells, and for periods 4 and beyond, the d and f subshells as well.