We measure the hydrostatic stress, uniaxial stress, and photo induced dependence of the channel conductance of two-dimensional electron gas AlGaN/GaN heterostructures grown on c-axis sapphire. The structures examined are grown by nitrogen-plasma molecular beam epitaxy and metal organic chemical vapor deposition. Electrical conductance measurements are made with four point probes on Hall bar samples. Both, hydrostatic stress and uniaxial stress result in changes in the conductance. Moreover, these changes in conductance have long settling times after the stress is applied and may be due to deep level defects, the energy levels of which change with stress. Stress coefficients extracted from the samples are partially attributed to deep level defects and to the piezoelectric effect resulting from different piezoelectric coefficients of GaN and AlN. Photo induced changes of the two-dimensional electron gas are also observed. We find that pulsed illumination produces long transient times in the conductance. These transients are reduced by thermal heating in some samples. However, they can still be present at 153°C.