How do atoms with different atomic numbers differ from each other?

They have different numbers of protons in the nucleus. That is what the atomic number means. They have an equal number of electrons, unless the atom is ionized.