Why does ionization energy increase as we go from left to right in a period?
Crash Course on Ionization Energy:


As we all know, atoms prefer a full valence shell. So as we go right in a period, we are increasing $e-$. And also ADDING PROTONS. Because we are adding protons, the size of the atom gets smaller because the nuclear charge will be more powerful. Adding protons in a period trumps the addition of electrons. At the end of the day, we have a small atom with many electrons in it's valence shell that does not want to let go of them. Especially the Noble Gasses and Halogens.
Ionization energy decreases as we move down a group because:

As we move down, a new full energy level is being added. More electrons means more repulsion.
This creates the shielding effect where the addition of the shells, shields the outer electron from receiving the nucleic charge. NOTE: Here, however the addition of another energy level trumps the addition of protons.



This is just a piece of the whole picture.