In this paper, we establish and analyze a stochastic human immunodeficiency virus model with both virus-to-cell and cell-to-cell transmissions and Ornstein–Uhlenbeck process, in which we suppose that the virus-to-cell infection rate and the cell-to-cell infection rate satisfy the Ornstein–Uhlenbeck process. First, we validate that there exists a unique global solution to the stochastic model with any initial value. Then, we adopt a stochastic Lyapunov function technique to develop sufficient criteria for the existence of a stationary distribution of positive solutions to the stochastic system, which reflects the strong persistence of all CD4+ T cells and free viruses. In particular, under the same conditions as the existence of a stationary distribution, we obtain the specific form of the probability density around the quasi-chronic infection equilibrium of the stochastic system. Finally, numerical simulations are conducted to validate these analytical results. Our results suggest that the methods used in this paper can be applied to study other viral infection models in which the infected CD4+ T cells are divided into latently infected and actively infected subgroups.