The correct answer is:
Cl; it takes much more energy to pull an electron away from a valence shell that is nearly full.
Chlorine (Cl) has a higher ionization energy compared to magnesium (Mg) because chlorine is one electron short of a full outer shell (it has 7 valence electrons), making its outer electrons more tightly bound and therefore requiring more energy to remove one. In contrast, magnesium (Mg) has 2 valence electrons and a lower ionization energy since it is easier to remove these 2 electrons to achieve the stable electron configuration of neon.