The energy required for the removal of an outermost electron from an isolated unipositive gaseous ion is called second ionization potential. Thus when Mg loses one electron, it forms Mg+ ion. The energy released during the process corresponds to first ionization potential.
When Mg+ ion loses one electron to form Mg2+ ion, the energy released is called second ionization potential.
Mg→Mg++e− ΔH= first ionization energy.
Mg+→Mg2++e− ΔH= second ionization energy.