In this paper, we consider a two-dimensional delay differential system with two delays. By analyzing the distribution of eigenvalues, linear stability of the equilibria and existence of Hopf, Bautin, and Hopf–Hopf bifurcations are obtained in which the time delays are used as the bifurcation parameter. General formula for the direction, period, and stability of the bifurcated periodic solutions are given for codimension one and codimension two bifurcations, including Hopf bifurcation, Bautin bifurcation, and Hopf–Hopf bifurcation. As an application, we study the dynamical behaviors of a model describing the interaction between tumor cells and effector cells of the immune system. Numerical examples and simulations are presented to illustrate the obtained results.