When an electron is added to a gaseous atom, energy is released to form a negative ion. This enthalpy change called the first electron gain enthalpy is thus negative.
But when an electron is added to the uni negative ion, it experiences repulsion from the anion due to which energy has to be supplied which overcomes the repulsion. Thus, the addition of the second electron requires energy due to which the second electron gain enthalpy is positive.
Although oxygen atom having six valence electrons requires two electrons to become stable, the formation of O− anion by a gain of an electron offers repulsion to the second electron due to which energy is to be supplied making second electron gain enthalpy positive.
O +e−→O− ΔH = -141KJ
O−+e−→O2− ΔH = 780 KJ