The first observations of gravitational waves emitted by merging binary black holes demonstrated the existence of black holes more massive than ever observed in our Galaxy. Future observations with ground-based interferometers such as Advanced LIGO and Virgo will probe the mass and spin distributions of black holes in various galactic environments and may also detect the stochastic gravitational-wave background from unresolved mergers. These measurements will provide a new tool for stellar and galaxy evolution studies. In the first part of this talk I will describe a cosmological framework for modeling the population of black holes and show which features of stellar evolution models can be constrained with future gravitational-wave observations. I will then discuss the stochastic background from unresolved binary black hole mergers and present the first predictions of the anisotropies of this background. In the second part of this talk I will discuss the prospects of detecting the stochastic gravitational wave background from super-massive black hole binaries that form when galaxies merge. I will argue that even under the most conservative assumptions this background will be detected in the coming years by Pulsar Timing Array experiments and possibly also by the space-based interferometer LISA.