What mass of magnesium chloride is formed in the reaction between 7 g of Mg and 7.9 g of Cl2

This is a limiting reagent problem. You know that because amounts are given for BOTH reactants.

Mg + Cl2 ==> MgCl2.

mols Mg = g/atomic mass = ?
mols Cl2 = grams/molar mass = ?

Using the coefficients in the balanced equation, convert mols Mg to mols MgCl2.
Do the same to convert mols Cl2 to mols MgCl2.
It is likely these two values will not be the same which means one of them is wrong. The correct value in limiting reagent problems is ALWAYS the smaller value and the reagent producing that value is the limiting reagent.

Using the smaller value, convert mols MgCl2 to g. g = mols x molar mass.