An analytical model of thermally stimulated photoluminescence (TSPL) in a random hopping system is formulated. The model is based on the assumption that TSPL originates from radiative recombination of sufficiently long geminate pairs of charge carriers created during photoexcitation of the sample at a low (helium) temperature. Since TSPL measurements are normally performed after some dwell time, the initial energy distribution of localized carriers is formed after low-temperature hopping relaxation of photogenerated carriers and, therefore, the first thermally assisted jumps of relaxed carriers are considered as the rate-limiting steps in the present model. Predictions of the model are found to be in good quantitative agreement with experimental data on molecularly doped polymers if a double-peak energy distribution of localized states is invoked for these materials. Comparing theoretical results with existing experimental data also reveals a somewhat slower low-temperature energy relaxation of charge carriers in these materials than predicted by the conventional theory of carrier random walk in random hopping systems. TSPL was also measured in a methyl-substituted ladder-type poly(paraphenylene). Both fluorescence and phosphorescence were found to contribute to the TSPL spectrum whereas only the latter was observed in the long isothermal afterglow following photoexcitation of the sample at helium temperature. This implies that the binding energy of a short off-chain geminate pair is higher than the binding energy of a singlet excitation but lower than that of a triplet exciton. The experimentally observed TSPL curve reveals an unusually low-temperature peak with the maximum at around 40 K. Interpretation of the experiment based on the hopping model of TSPL yields an effective density of states width of 0.055 eV, in good agreement with the value of 0.050 eV estimated from transport measurements.