We present a detailed investigation performed at low temperature (T < 50 K) concerning the exciton dynamics in GaN epilayers grown on c-plane sapphire substrates, focusing on the exciton formation and the transition from the nonthermal to the thermal regime. The time-resolved kinetics of longitudinal-optical-phonon replicas is used to address the energy relaxation in the excitonic band. From picosecond time-resolved spectra, we bring evidence for a long lasting nonthermal excitonic distribution, which accounts for the first 50 ps. Such a behavior is confirmed in different experimental conditions when both nonresonant and resonant excitations are used. At low excitation power density, the exciton formation and their subsequent thermalization are dominated by impurity scattering rather than by acoustic phonon scattering. The estimate of the average energy of the excitons as a function of delay after the excitation pulse provides information on the relaxation time, which describes the evolution of the exciton population to the thermal regime. DOI: 10.1103/PhysRevB.87.075202