Cosmological observations are a powerful probe of neutrino properties, and in particular of their mass. In this review, we first discuss the role of neutrinos in shaping the cosmological evolution at both the background and perturbation level, and describe their effects on cosmological observables such as the cosmic microwave background and the distribution of matter at large scale. We then present the state of the art concerning the constraints on neutrino masses from those observables, and also review the prospects for future experiments. We also briefly discuss the prospects for determining the neutrino hierarchy from cosmology, the complementarity with laboratory experiments, and the constraints on neutrino properties beyond their mass.