Temperature-dependent photoluminescence (TDPL), one of the most effective and powerful optical characterisation methods, is widely used to investigate carrier transport and localized states in semiconductor materials. Resonant excitation and non-resonant excitation are the two primary methods of researching this issue. In this study, the application ranges of the different excitation modes are confirmed by analysing the TDPL characteristics of GaN-based light-emitting diodes. For resonant excitation, the carriers are generated only in the quantum wells, and the TDPL features effectively reflect the intrinsic photoluminescence characteristics within the wells and offer certain advantages in characterising localized states and the quality of the wells. For non-resonant excitation, both the wells and barriers are excited, and the carriers that drift from the barriers can contribute to the luminescence under the driving force of the built-in field, which causes the existing equations to become inapplicable. Thus, non-resonant excitation is more suitable than resonant excitation for studying carrier transport dynamics and evaluating the internal quantum efficiency. The experimental technique described herein provides fundamental new insights into the selection of the most appropriate excitation mode for the experimental analysis of carrier transport and localized states in p-n junction devices.