We study the existence of surfaces with constant or prescribed Gauss curvature in certain Lorentzian spacetimes. We prove in particular that every (non-elementary) 3-dimensional maximal globally hyperbolic spatially compact spacetime with constant non-negative curvature is foliated by compact spacelike surfaces with constant Gauss curvature. In the constant negative curvature case, such a foliation exists outside the convex core. The existence of these foliations, together with a theorem of C. Gerhardt, yield several corollaries. For example, they allow to solve the Minkowski problem in the 3-dimensional Minkowski space for datas that are invariant under the action of a co-compact Fuchsian group.