Early Atomic Masses
In the midst of postulating his Atomic Theory, John Dalton compiled a list of atomic masses. Of course Dalton couldn't actually weigh any atoms, so he developed a relative scale. Since hydrogen was the lightest element he gave that an atomic mass of 1. Then when he determined that carbon was 12 times heavier than hydrogen he gave it a mass of 12.
The problem with this scale is that hydrogen, as a lighter than air gas, is difficult to weigh. Additionally, because it is explosive, it is difficult to work with. As a result the standard for atomic masses was changed to carbon. Since chemists were already used to thinking of carbon as having a mass of 12, the new standard was that carbon was exactly 12 and everything else would be considered relative to that. So, since hydrogen only weighs 1/12th as much as carbon, its mass would be 1 (some change).
There were several things that complicated this picture. One was the creation of the mass spectrometer. The other was the discovery of the neutron and isotopes.
The mass spectrometer allowed an element (or molecule) to be vaporized (made into a gas) and then ionized (given a charge). These charged particles were then accelerated through an electric field (attracted to a plate with the opposite charge and pushed from behind by a plate with the same charge.) They were then bent by a magnetic field. How much their path was bent depended on their mass. The result was that relative masses could be determined very precisely.
What we learned, however, was that carbon was not exactly 12 times the mass of hydrogen.
The other thing we learned around this time, and with the help of the mass spectrometer was the not all atoms of the same element have the same mass. For instance some most carbon atoms weigh about 12 times the mass of a hydrogen, but a few weigh 13 times as much as a hydrogen atom, and a very small fraction of carbon atoms weigh 14 times as much as a hydrogen atom. These atoms of the same element with different masses were called isotopes.
Resetting the Scale
As a result of these discoveries, the scale was reset so that the standard became an atom of the most common form of carbon. In other words, the most common isotope of carbon would be defined to weigh exactly 12.000000000000000000... a.m.u. (atomic mass units--a unit we made up so that we could have some unit in which to think about these masses).
Today all masses of atoms are measured relative to the 12C standard (pronounced carbon 12).
Of course, we rarely have a sample of only one isotope. That required us to develop the idea of average atomic mass.