Even in classical mechanics the Hamiltonian ##H## may be interpreted as the energy only when it does not depend explicitly on time. Otherwise, ##H(t)## is just that - the Hamiltonian, a function (obtained through the Legendre transform of a Lagrangian) which enters into Hamilton's equations of motion, the Hamilton-Jacobi equation, etc.
Likewise, in quantum mechanics the Hamiltonian can be interpreted as the energy operator only when it does not depend explicitly on time, because in this case the Schrödinger equation ##\mathrm{i}\hbar\partial_t \Psi = H\Psi## separates and one reduces it to the eigenvalue problem ##H\psi = E\psi##. Otherwise, the Hamiltonian operator ##H(t)## is just a differential operator which enters into the Schrödinger equation ##\mathrm{i}\hbar\partial_t \Psi = H(t)\Psi## and now you cannot reduce it to the eigenvalue problem, because it is a genuine evolution equation for ##\Psi##.
That being said, you can treat quantum-mechanical problems with time-dependent Hamiltonians using various approximate methods, the 3 most popular of them being: (i) the time-dependent perturbation theory, (ii) the adiabatic approximation, and (iii) the "sudden" approximation. In approach (i), you write the time-dependent Hamiltonian as ##H(t) = H_0 + V(t)##, where the time-dependence is assumed to be included solely in some perturbation ##V(t)##. Then for ##H_0## you can formulate the eigenvalue problem, and the role of ##V(t)## is then to induce transitions between various eigenstates of ##H_0##. In approach (ii), you assume that the time-dependence of the Hamiltonian does not induce transitions to other states, and that for each particular instance of time ##t_0## you write the "eigenvalue" problem as ##H(t_0)\psi = E(t_0)\psi##, so that the eigenvalues ##E(t_0)## depend parametrically on time. In approach (iii), you assume that the Hamiltonian is actually time-independent during some period of time ##(t_0, t_1)##; then it suddenly changes into another time-independent Hamiltonian and it stays that way during the period of time ##(t_1, t_2)##, and so on. But all of these are approximate methods, which may or may not work well in particular situations, and they exist predominantly to treat the genuine evolution equation ##\mathrm{i}\hbar\partial_t \Psi = H(t)\Psi## in as simple way as possible (though not always exact).