The book is devoted to the theory of gradient flows in the general framework of metric spaces, and in the more specific setting of the space of probability measures, which provide a surprising link between optimal transportation theory and many evolutionary PDE's related to (non)linear diffusion. Particular emphasis is given to the convergence of the implicit time discretization method and to the error estimates for this discretization, extending the well established theory in Hilbert spaces. The book is split in two main parts that can be read independently of each other.