The stress in GaN thin films grown on sapphire is shown to be determined by lattice mismatch, by differences in thermal-expansion-coefficients and by the incorporation of point defects. It can be controlled by the buffer layer thickness, the buffer layer growth temperature, the V/III flux ratio, and by doping. It is argued that a Fermi-level dependence of defect formation energies affects the material stoichiometry and thereby lattice constants and stresses. We observed that stress relaxation occurred if the stresses exceeded a critical compressive or tensile stress value. The stress changes materials properties. As an example, it is demonstrated that the electron Hall mobility in GaN:Si can be increased with constant electron carrier concentration if large compressive stress is present.