Every atom of a given element has the same number of protons in its nucleus. This number is called the atomic number (also called the proton number). It is the smaller number in the nuclear symbol, for example the 6 in 126C.
The atomic number is unique to each element. All carbon atoms have 6 protons and no other element has 6 protons. All atoms with 8 protons are oxygen, and all atoms with 11 protons are sodium. This is why the number of protons is what decides which element an atom belongs to.
The periodic table is arranged in order of atomic number. Hydrogen has atomic number 1, helium 2, lithium 3 and so on. If the number of protons in an atom changed, it would become a different element. Chemical reactions do not change the nucleus, so the number of protons in an atom stays the same during a reaction.