The position of a given element in the periodic table depends on the atomic number. Further the atomic number is equal to the number of protons and the number of electrons of the particular element.
Also for the considered element, depending on the atomic number, the placement in the periodic table will create groups (columns) and periods (rows).
As a example we will take two atoms carbon (C) and nitrogen (N):
carbon (C) - has a atomic number of 6, it contains 6 protons and 6 electrons, and you find this element in the group 14 and period 2 in the periodic table
nitrogen (N) - has a atomic number of 7, it contains 7 protons and 7 electrons, and you find this element in the group 15 and period 2 in the periodic table