We present an experimental and theoretical study of the size dependence of the coupling between electron-hole pairs and longitudinal-optical phonons in Ga1-xInxN/GaN-based quantum wells and quantum boxes. We found that the Huang-Rhys factor S, which determines the distribution of luminescence intensities between the phonon replicas and the zero-phonon peak, increases significantly when the vertical size of the boxes or the thickness of quantum well increases. We assign this variation to (1) the strong electric field present along the growth axis of the system, due to spontaneous and piezoelectric polarizations in these wurtzite materials, and (2) the localization on separate sites of electrons and holes in the plane of the wells or boxes, due to potential fluctuations in the ternary alloy. Indeed, envelope-function calculations for free or localized excitons, with electron-hole distance only controlled by Coulomb interaction, do not account quantitatively for the measured behavior of the S factor. In fact, the latter is rather similar to what is obtained for donor-acceptor pairs, with a statistical distribution of distances between localization centers for electrons and holes. (C) 2002 American Institute of Physics.