We investigate the Cattaneo–Christov heat flux model for a two-dimensional laminar boundary layer flow of an incompressible Oldroyd-B fluid over a linearly stretching sheet. Mathematical formulation of the boundary layer problems is given. The nonlinear partial differential equations are converted into the ordinary differential equations using similarity transformations. The dimensionless velocity and temperature profiles are obtained through optimal homotopy analysis method (OHAM). The influences of the physical parameters on the velocity and the temperature are pointed out. The results show that the temperature and the thermal boundary layer thickness are smaller in the Cattaneo–Christov heat flux model than those in the Fourier’s law of heat conduction.