The horizontal rows in the periodic table are called periods.
The horizontal rows in are periods, while the vertical rows are called groups.
The elements moving from left to right in “periods” have increasing atomic numbers. These atomic numbers represent the total number of protons and electrons in the neutral atom as it exists.
Oxygen has an atomic number of 8 which means there are 8 protons in the nucleus and 8 electrons orbiting the nucleus. This balance keeps oxygen as a neutral element as you see it on the periodic table.
The columns 1-18 are groups or families. These elements are grouped by commonalities. For example, group 18 consists of the “noble gases.” These elements (helium, neon, argon, krypton, xenon, radon) all have full outer electron shells or 8 valence electrons. They all exist on different “rows” or periods but exist as one big family based on similarities.