Good question. On the surface, they both appear to be very similar, because both ionization energy and electron affinity both deal with an atom's ability to do something with electrons. The difference between electron affinity and ionization energy is what is happening with the electrons and consequently the resulting charge of the neutral atom.
Ionization energy refers to how much energy is needed to remove the outer most electron from an atom. In other words, it measures how much the atom resists losing an electron. Or it measures how hard the atom holds onto its electrons. Higher ionization energies mean that it takes more energy to strip away an electron. If an electron is removed, the overall charge of the atom is positive.
Electron affinity is the opposite. It is a measurement of how likely the atom is to gain an electron. The resulting atom would then be negatively charged.
The periodic table is set up nicely to summarize general trends of ionization energy and electron affinity. Moving up a group increases both, and moving across a period increases both.