Molecular mass is for molecules, formula mass is for ionic compounds. Molecular mass and formula mass mean pretty much the same thing. The only reason we use two different terms is because molecules are covalent compounds meaning they have only non-metals so then an ionic compounds cannot be a molecule and therefore it wouldn't make sense to find the molecular mass for an ionic compound so we just call it the "formula mass" when we're talking about ionic compounds.
Here's what you need to know:
Molecular mass: For covalent compounds, compounds that contain ONLY non-metals such as CO2.
Formula mass: For ionic compound, compounds that contain metals and non-metals such as Na2CO3.
Metals are on the left of the periodic table and non-metals are on the right of the periodic table.