The atomic size decreases on moving from left to right in a period as the number of valence electrons in the same shell increases due to which the effective nuclear charge increases. Thus, size of $\mathrm{O}$ is less than $\mathrm{N}$ and also size of $\mathrm{S}$ is less than $\mathrm{P}$.
Now, on moving down in a group atomic size increases because each time one new shell is added and electrons in the outermost shell move away from the nucleus. Thus, size of $\mathrm{O} < \mathrm{S}$ and $\mathrm{N} < \mathrm{P}$. Thus, the overall order is $\mathrm{O} < \mathrm{N} < \mathrm{S} < \mathrm{P}$.