Thin films of GaN and its alloy AlGaN are investigated with respect to their properties of the persistent photoconductivity (PPC). In this work, we show that the film-substrate interface plays an important role for the metastable electrical effect. Strongly absorbed bandgap light causes an increase of photoconductivity which is about one order of magnitude higher when the sample is illuminated from the substrate side near the interface than from the growth side. To access the interface properties at the substrate, we use temperature-dependent Hall effect measurements. The smallest PPC effect was observed for the GaN film with the best interface properties grown on SiC.