Using Couette and Poiseuille flows, we extract the temperature dependence of the slip length, delta, from molecular dynamics simulations of a coarse-grained polymer model in contact with an attractive surface. delta is dictated by the ratio of bulk viscosity and surface mobility. At weakly attractive surfaces, lubrication layers form; delta is large and increases upon cooling. Close to the glass transition temperature T(g), very large slip lengths are observed. At a more attractive surface, a sticky surface layer is built up, giving rise to small slip lengths. Upon cooling, delta decreases at high temperatures, passes through a minimum, and grows for T -> T(g). At strongly attractive surfaces, the Navier-slip condition fails to describe Couette and Poiseuille flows simultaneously. The simulations are corroborated by a schematic, two-layer model suggesting that the observations do not depend on details of the computational model.