Given the critical role of time delays in epidemic modeling, this paper delves into the dynamics and finite-time optimal stabilization of a novel epidemic system characterized by such delays. Our findings reveal that time delays significantly influence both the system’s dynamics and the formulation of an optimal control strategy. Specifically, the system’s endemic equilibrium point remains locally asymptotically stable under mild conditions for small time delays. However, exceeding critical delay thresholds induces Hopf bifurcation. To closely regulate the system’s state towards the equilibrium point and minimize control costs, we propose an optimal control problem. We derive the explicit form of the optimal control strategy employing Pontryagin’s Maximum Principle. Finally, numerical simulations further confirm the theoretical results obtained in this paper.