Water and nitrogen (N) are major constraints for cotton growth and yield formation in arid regions. Irrigation and N application have been widely investigated to improve crop yield and water and N use efficiency (NUE). However, further optimization of water and N management is needed because the effects of N application on soil N balance and N loss under different irrigation levels remain unclear. In this study, a field experiment was conducted in 2020 and 2021 to investigate the effects of different irrigation amounts (full irrigation (100% ETc), moderate irrigation (80% ETc), low irrigation (60% ETc)) and N application rates (control (without N application, N0), low N (150 kg ha−1, N150), medium N (225 kg ha−1 and 300 kg ha−1, N225 and N300), and high N (375 kg ha−1, N375)) on cotton yield, NUE, and soil N balance. The 2-year results showed that under the 60% ETc treatment, cotton dry matter accumulation, N uptake, and yield were significantly enhanced by increasing N application. Under the 80% and 100% ETc treatments, these parameters peaked with the N300 treatment; the N375 treatment showed no significant difference or decrease compared to the N300 treatment. The 80% ETc N300 treatment had the highest cotton yield and NUE, which increased by 17.49–106.57% and 12.28–88.78% compared with other treatments, respectively. Residual soil N accumulation (RSNmin), apparent N loss (ANL), and apparent N surplus (ANS) increased as the N application rate increased under the 60% and 100% ETc treatments. While under the 80% ETc treatment, the ANS did not significantly differ between the N225 and N300 treatments, ANL significantly decreased by 43.51–88.56% when the N application rate increased from 150 to 225 and 300 kg ha−1. The ANL of the 80% ETc N300 treatment was the lowest, but ANS did not significantly increase. The regression analysis and spatial analysis results showed that under irrigation of 336–348 mm and N application of 254–327 kg ha−1, cotton yield, NUE, and WPI reached more than 80% of the maximum value, with less apparent N loss, thus maintaining the soil N balance in drip-irrigated cotton fields. This study helps to improve the utilization of water and N resources in cotton production. Future research on optimizing water and N management needs to more fully consider environmental pollution to achieve sustainable development of agricultural ecosystems.