Any atom can differ in the amount of any of the three particles in each of them.
If the number of protons is different, the atoms are of two different elements. The number of neutrons in atoms of different elements can be the same and the number of neutrons in two atoms of the same element can be different.
The number of protons in the atoms of each element is fixed to its 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.