In fourth period, 18 elements are present. In this period electrons are entering into fourth energy level, i.e., n = 4. it starts with the filling of 4s-orbitals. However, after the 4s, but before the 4p orbitais, there are five 3d-orbitals also to be filled. Thus, nine orbitais (one 4s, five 3d and three 4p) have to be filled. These nine orbitais can accommodate (9 x 2 = 18)18 electrons.
Hence, period contain 18 elements in it.