Atoms are made up of three types of particles; these are electron, proton and neutron. The number of electrons and protons in any atom is the same as these particles have an electrical charge of opposite sign but the same magnitude and atoms are inherently neutral in nature.
Any two atoms can differ in the number of any of the three particles in each of them. Only if the number of protons (and consequently the electrons) is different, the atoms are of two different elements. The number of neutrons in atoms of different elements can be the same and so can the number of neutrons in two atoms of the same element be different.
The number of protons in the atoms of each element is unique and this is referred to as the atomic number. The atomic mass can be the same across atoms of different elements but the atomic number is the same. It is therefore accurate to say that atoms of different elements can be identified solely by the number of protons.