The hyperpolarizabilities of the hydrogenlike atoms in Debye and dense quantum plasmas are calculated using the sum-over-states formalism based on the generalized pseudospectral method. The Debye-Hückel and exponential-cosine screened Coulomb potentials are employed to model the screening effects in, respectively, Debye and dense quantum plasmas. Our numerical calculation demonstrates that the present method shows exponential convergence in calculating the hyperpolarizabilities of one-electron systems and the obtained results significantly improve previous predictions in the strong screening environment. The asymptotic behavior of hyperpolarizability near the system bound-continuum limit is investigated and the results for some low-lying excited states are reported. By comparing the fourth-order corrected energies in terms of hyperpolarizability with the resonance energies using the complex-scaling method, we empirically conclude that the applicability of hyperpolarizability in perturbatively estimating the system energy in Debye plasmas lies in the range of [0,F_{max}/2], where F_{max} refers to the maximum electric field strength at which the fourth-order energy correction is equal to the second-order term.