This study focuses on investigating the dynamical properties of a differential model for the human immunodeficiency virus (HIV) involving the effect of antiretroviral therapy (ART). The model is composed of four cell populations: target cells, infected cells, free virions, and effector cells involving viral production delay. Further, the parameters in the model are estimated with the help of clinical data. The activation of the immune response against a foreign agent potentially in impairment is discussed. This study explores the effects of time delay under ART through stability properties. The basic reproduction number is derived to ensure community spread. Also, this paper performs stability analysis for disease-free, immune-free, and infection-steady states. In addition, bifurcation analyses are performed by choosing viral production time-delay as a bifurcation parameter. Further, the existence of Hopf bifurcation with respect to time delay is confirmed, and the corresponding threshold value for delay is derived and validated. This paper formulates the optimal control problem by choosing the ART therapy coefficient as a control parameter and investigating it through the Hamiltonian-Lagrangian method and Pontryagin's maximum principle. Moreover, numerical simulations are performed to validate the proposed stability and bifurcation conditions with estimated and referred parameter values.