I'm going to answer this by using rounded numbers for the atomic masses. You need only go back and put the numbers in from your periodic table. My answers will be close, but not what you should get.
Find the Molar Mass of MgCl2
Mg = 24 grams
2Cl = 2 * 35.5 = 71 grams
Total = 95 grams
Find the mols in 339 grams
1 mole = 95 grams
x mol = 339
Solve
339 = 95x Divide by 95
339/95 = x
x = 3.67 mols Answer