Through systematic control of the Nd concentration, we show that the carrier density of the two-dimensional electron gas (2DEG) in SrTiO_{3}/NdTiO_{3}/SrTiO_{3}(001) can be modulated over a wide range. We also demonstrate that the NdTiO_{3} in heterojunctions without a SrTiO_{3} cap is degraded by oxygen absorption from air, resulting in the immobilization of donor electrons that could otherwise contribute to the 2DEG. This system is, thus, an ideal model to understand and control the insulator-to-metal transition in a 2DEG based on both environmental conditions and film-growth processing parameters.