Atoms can have different numbers of neutrons, but the same number of protons. These atoms are the same elements, but have different atomic masses. Atoms of the same element but different masses are known as isotopes.
On a periodic table you may have noticed that the atomic mass is always a decimal number. For example hydrogen has an atomic mass of 1.0078.
If atomic mass is the number of protons and neutrons then does this mean that hydrogen has .0078 neutrons?
No it does not. you cannot have fractions of protons, neutrons, or electrons in an atom.
The atomic mass on the periodic table is a weighted average of all the hydrogen in the universe. Scientists measure the light from stars, nebula, and planets to estimate the abundance of each type of element. Using this technique we know that most of the hydrogen in the universe has a mass of 1 amu, but occasionally you may find a hydrogen with an atomic mass of 2 amu or even 3 amu.
Taking the weighted average is similar to calculating grades. You must multiply the percentage (as a decimal) that each category counts toward your grade by your average score for that category. Then you add together the results to find the your overall average.
(82 x .2) + (90 x .35) + (76 x .45) = 82.1
Your overall grade would be 82.1
A weighted atomic mass is important because in any given sample of an element you could have a mix of several isotopes. This gives you a reliable estimate of the mass of a sample.