We report a low-temperature photoluminescence study of a series of AlxGal-xN/GaN quantum wells of various widths L and with x ranging from 0.11 to 0.25, grown by molecular beam epitaxy on silicon (111) substrates. Such quantum wells are subject to an important Stark effect owing to the large macroscopic polarization (piezoelectric and spontaneous) difference between wells and barriers. Due to the opposite actions of carrier confinement and of the Stark effect on the quantum well transition energies, it appears that around a certain thickness L-0 similar to 26 angstrom, these transition energies are independent of the barrier composition, at least in the x range studied. This has already been reported in similar structures grown on sapphire [Grandjean et al., J. Appl. Phys. 86 3714 (1999)]. In such quantum wells, the inhomogeneous broadening originates essentially from well width fluctuations and alloy composition fluctuations. The effect of the latter is then expected to be minimum near L=L-0. We show that it is indeed the case by studying the well width and barrier composition dependence of the linewidth of the quantum well luminescence lines, for samples grown on both Si and sapphire. The x dependence of the minimum linewidth at L similar to L-0 allows to estimate a very small variance of the well width distribution (sigma(L) similar to 1 angstrom), and this is discussed in relation with scanning tunneling microscopy images of GaN surfaces. Afterwards, using the fact that confinement energies in wide wells become nearly independent of well width, the variance of barrier composition fluctuations within the excitonic lateral extension is estimated from the L dependence of linewidths at each barrier composition. The values we obtain for this excitonic lateral extension are in agreement with variationnal calculations of the in-plane exciton Bohr radius in such heterostructures.