Lewis model and modern physics
The Born-Haber Cycle might help you visualizing how those values are used. Notice the values used bellow are a bit different from the ones you got.



Electron affinity 


  The amount of energy released when an electron is added to a neutral
  atom or molecule to form a negative ion.


Ionization energy 


  The amount of energy required to remove an electron from the atom.


Enthalpy of formation (ΔH) 


  The change of enthalpy that accompanies the formation of 1 mole of the
  compound from its elements.