The atomic number of an element was originally just its position on the periodic table. After the discovery of protons, scientists realised that the atomic number of an element is the same as the number of protons in its nucleus.
In the modern periodic table, the elements are arranged according to their atomic number - not their relative atomic mass.
In the periodic table the elements are arranged into:
The metal elements are found on the left hand side of the periodic table, and the non-metal elements are found on the right. You can imagine a zigzag line, starting at B-Al-Si, separating metals from non-metals.
The positions of iodine and tellurium were reversed in Mendeleev's table because, although iodine has a lower relative atomic mass, its chemical properties show that it should be in the same group as chlorine and bromine.
It was only later, when scientists were able to work out the atomic number of elements, that it was discovered the atomic number of tellurium is 52 and the atomic number of iodine is 53. Therefore, Mendeleev was correct in the order that he placed these elements in the periodic table.