To find the molar mass of each compound we need the molar masses of the elements in the compound and its chemical formula.
For magnesium sulfate, MgSO₄, there are 1 atom of magnesium, one of sulfur and 4 of oxygen. Multiply each molar mass by the number of atoms of the element and then find the sum of those products:

The molar mass of magnesium sulfate is 120.310g/mol.
For diphosphorus heptoxide, P₂O₇, there are 2 atoms of phosphorus and 7 of oxygen:

The molar mass of diphosphorus heptoxide is 173.940g/mol.
For iron(III) hydroxide, Fe(OH)₃, there are 1 atom of iron, 3 of hydrogen and 3 of oxygen:

The molar mass of iron(III) hydroxide is 106.840g/mol.