Uranium nitride is a material of considerable fundamental interest and is a promising candidate for an advanced nuclear fuel. We here study intrinsic point defects and incorporation of the fission gas atoms Kr and Xe in UN by density functional theory, including the first report of the effects of nonstoichiometry. The defect formation energies of U and N vacancies are found to be highly dependent on stoichiometry. The most stable defect types are N vacancies under U-rich and near-stoichiometric conditions but U vacancies under N-rich conditions. The existence of a defect significantly affects the magnetic moment of UN, especially defects involving U vacancies. The incorporation of Kr and Xe in UN induces relaxation of the atomic positions of U and N atoms adjacent to Kr or Xe, with the displacement induced by Xe being more significant than that by Kr due to the larger atomic radius of the former. The calculated solution energy of Kr and Xe in a perfect UN supercell shows that the most energetically favorable sites are Schottky defects and U vacancies under U-rich and N-rich conditions, respectively. Under near-stoichiometric conditions, Kr and Xe behave differently, with the former preferring a U vacancy and the latter preferring the Schottky defect. Bader charge analysis indicates larger charge transfer to noble gases on Kr incorporation than on Xe incorporation, consistent with the higher electronegativity of Kr.