The temperature dependence of the energy relaxation of photoexcited (PE) carriers is used as a probe of the electronic structure of YBa_2Cu_3O_(7-d) in the insulating d~0.8 and metallic d~0.1 phases. The energy relaxation rate to phonons is obtained by measuring the non-equilibrium phonon occupation number, n_neq, with pulsed Raman Stokes/anti-Stokes spectroscopy using 1.5 and 70 ps long laser pulses. We can distinguish between relaxation via extended band states and localized states, since theoretically in the former, the relaxation is expected to be virtually T-independent, while in the latter it is strongly T-dependent. From the experiment - which shows strong temperature dependence of n_neq - we deduce that at least part of the PE carrier relaxation proceeds via hopping between localized states and we propose a simple theoretical model of the relaxation process. In addition, we compare the coupling of different vibrational modes to the carriers to find that the apical O vibrational mode is significantly more involved in the energy relaxation process that the in-plane 340 cm^(-1}) mode. This implies that the localized states are mainly (but not entirely) coupled to out-of plane vibrations.