The heat energy released when new bonds are made between the ions and water moleculesis known as the hydration enthalpy of the ion. The hydration enthalpy is the enthalpy change when 1 mole of gaseous ions dissolve in sufficient water to give an infinitely dilute solution. Hydration enthalpies are always negative. Larger the atomic size lesser the hydration energy or the energy decreases.
The size of Li+ greater than Mg2+.So, the hydration energy of Mg2+ is greater than Li+.So, the correct order of hydration energy is Mg2+>Li+.