There are several aspects to the organization of the periodic table of the elements.
First, all the elements are ordered, going left to right, by atomic number – which is the number of protons in the nucleus of an atom of that element. So, the first is hydrogen, with atomic number 1, then next is Helium with atomic number 2, etc.
Next, there are rows which relate to the quantum mechanical theory of electron shells. A new row starts in the table when the previous shell has been filled.
The vertical organization is usually considered the most important, since the blocks formed by columns reveal many of the chemical properties of the elements in that group. Specifically, elements are grouped in s, g, f, p, and d blocks according to the subshell in which the ‘last’ electron resides.