Hello! It's simple to misuse these 2 definitions, although they have slightly different connotations.
The Atomic number equals the number of protons (and protons only) in an atom. Mass number in general is the number of nuclear particles such as protons and neutrons.
Hope this will be helpful for you!