What exactly does the term "gram atoms" mean?
$\ce{MgB2}$ is 1 gram-molecule of $\ce{MgB2}$ but 3 gram-atoms of $\ce{MgB2}$.

Why is this so? Let us consider this problem in the familiar mole:

If we were asked how many moles of the substance (molecule) were in this, we would state 1 mole, if there were $\pu{45.3 g}$ of substance. However, if we were asked how many moles of atoms were in the substance, we would accordingly state 3. Thus, in one molecule, there are 3 atoms, so if we simply consider the number of atoms, there would be the necessity of counting the number. of atoms in a molecule, as a molecule is comprised of more than a single atom

* This is purely hypothetical. One would probably not consider  $\ce{MgB2}$, as J. LS pointed out, it decomposes . However, the concept can be applied to other compounds