The quantity molar mass (quantity symbol: $M$) for a pure sample is defined as
$$M = m/n$$
where $m$ is mass and $n$ is amount of substance.
The dimension of the molar mass is
$$\dim M = \mathsf{M}\;\mathsf{N}^{-1}$$
The coherent SI unit for molar mass is ‘kilogram per mole’ (unit symbol: $\mathrm{kg/mol}$).
(The usually used unit is gram per mole ($\mathrm{g/mol}$) rather than kilogram per mole ($\mathrm{kg/mol}$).)
The quantity relative molecular mass (quantity symbol: $M_\mathrm{r}$) is defined as the ratio of the average mass per molecule or specified entity of a substance to 1/12 of the mass of an atom of the nuclide $\ce{^12C}$; i.e. the relative molecular mass is the ratio of the mass of a molecule to the unified atomic mass constant:
$$M_\mathrm{r} = m_\mathrm{f}/m_\mathrm{u}$$
where $m_\mathrm{f}$ is mass of entity (molecule or formula unit) and $m_\mathrm{u}$ is the unified atomic mass constant.
The relative molecular mass is a quantity of dimension one (for historical reasons, a quantity of dimension one is often called dimensionless):
$$\dim M_\mathrm{r} = 1$$
The coherent SI unit for relative molecular mass is the unit one (symbol: $1$).
For historical reasons, the IUPAC accepts the use of the special name ‘molecular weight’ for the quantity relative molecular mass. The use of this traditional name is deprecated.
For atoms, the relative molecular mass $M_\mathrm{r}$ is the relative atomic mass, and the quantity symbol $A_\mathrm{r}$ may be used. The quantity relative atomic mass is defined as the ratio of the average mass per atom of an element to 1/12 of the mass of an atom of the nuclide $\ce{^12C}$:
$$A_\mathrm{r} = m_\mathrm{a}/m_\mathrm{u}$$
where $m_\mathrm{a}$ is the atomic mass (see below) and $m_\mathrm{u}$ is the unified atomic mass constant.
The relative atomic mass is a quantity of dimension one:
$$\dim A_\mathrm{r} = 1$$
The coherent SI unit for relative atomic mass is the unit one (symbol: $1$).
For historical reasons, the IUPAC accepts the use of the special name ‘atomic weight’ for the quantity relative atomic mass. The use of this traditional name is deprecated.
The quantity atomic mass (quantity symbol: $m_\mathrm{a}$) is defined as rest mass of a neutral atom in the ground state.
The dimension of the atomic mass is
$$\dim m_\mathrm{a} = \mathsf{M}$$
The coherent SI unit for atomic mass is ‘kilogram’ (unit symbol: $\mathrm{kg}$).