If $M$ is a closed, simply connected smooth manifold, then the rank of the rational homotopy groups $\pi_i(M)\otimes Q$ equals the number of degree $i$ generators introduced in the construction of the minimal model of $M$. For certain manifolds that are formal (e.g., if $M$ is Kahler), their cohomology ring is quasi-isomorphic as a DGA to their minimal model, so that one can use the cohomology ring through the minimal model to compute the ranks of the rational homotopy groups.
A nice example where one can use the cohomology to read off the rational homotopy is the case of the oriented Grassmannian $BSO(n)$. Its rational cohomology ring is precisely the polynomial algebra generated by the Pontryagin classes and the Euler class for even $n,$ and the Pontryagin classes alone for odd $n$. Thus, the rational homotopy groups have rank exactly 1 every $4k$ dimensions for $BSO(even)$, and rank exactly 1 every $4k$ dimensions in $BSO(odd)$ except for one index where one may have rank 2 (due to the presence of the Euler class and Pontryagin class). One also ignores the last index in this latter case, as the Euler class squares to the top Pontryagin class.