Atoms are far too light to weigh in grams, so their masses are compared with a standard. The standard is the unified atomic mass unit, u, which is one twelfth of the mass of one atom of carbon-12. One carbon-12 atom has a mass of exactly 12 u.
A relative mass is a ratio, so it has no unit. Relative atomic mass, Ar, is a weighted mean because most elements are a mixture of isotopes.
For a substance made of molecules we add the Ar values to get the relative molecular mass, Mr. For an ionic compound, which has no molecules, the same sum is called the relative formula mass.