The energy required to remove an electron from an isolated gaseous atom in its ground state is known as ionisation energy. The closer and more tightly bound an electron is to the nucleus, the more difficult it will be to remove, and the higher its ionization energy will be. Ionization energies increase on moving from left to right across a period (decreasing atomic radius). As we move along a period, the nuclear charge increases and the electrons are added into the same shell. Thereby the effective nuclear charge increases and size decreases. Therefore, the energy required to remove an electron increases.
Ionization energy decreases down a group in the periodic table due to the fact that the outermost electrons are further away from the nucleus. The increase in distance between the positive nucleus and the negative electrons creates a weaker attraction between the two. As a result, less energy is needed to remove an electron from elements located lower on the periodic table.
Ionisation energy depends on:
Atomic radius- Larger the atom lesser the attractive force felt by the valence electrons. Hence lesser energy is required to pull out an electron . Thus ionisation energy is small. For smaller atoms reverse is true. Smaller atoms have higher ionisation energy.
Nuclear charge- If the nuclear charge is more the attractive force on the valence electron is more. The energy required to pull out the valence electron will be high and ionisation energy will be high.
Stability of half filled and completely filled orbitals- The atoms with fully filled and half filled orbitals have greater stability than the others. Therefore they require greater energy for removing an electron.
Here the electronic configuration of atomic number of nitrogen is 15 and its outer electronic configuration is 2s2 2p3. Oxygen has atomic number 16 and its outer electronic configuration is 2s2 2p4. 2s2 2p3 is more stable than 2s2 2p4 due to half filled p sublevel. Hence nitrogen atom has greater ionisation energy than oxygen.
Hence option D is the correct answer.