Ionization energy is the energy it takes to remove the outermost electron from a neutral atom in the gas phase. Electron affinity is the energy given off when a neutral atom in the gas phase gains an extra electron. Electron affinity is much harder to measure than ionization energy. Generally, both electron affinity and ionization energy increase as you go up the periodic table, and as you go to the right of the table.