I heard it said that the cohomology rings of some Lie groups and Grassmannians can be read from the Dynkin graph. Can someone give me any reference?



the relation between cohomology  and Dynkin graphs of lie groups 
Your question involves a complex (semi)simple Lie group, I guess, and its Dynkin diagram. The topology of Lie groups and their homogeneous spaces $G/P$ (such as Grassmannians) is an old and rich subject (E. Cartan, Stiefel, Samelson, Bott, Kostant, Chevalley, Borel, ...) which can be approached from a number of viewpoints such as deRham cohomology and Morse theory. Most basic is the reduction of the problem to determination of the topology of a compact real form. Cohomology rings turn out to be intimately related to the invariant theory of Weyl groups and to the alcove geometry of associated affine Weyl groups (Stiefel diagram). Some of this is encoded in the Dynkin diagram, but working out for example the coinvariant algebra of the Weyl group takes further work.


I'm not a specialist in this area, but am aware of numerous textbook treatments of compact Lie groups: structure, representations, cohomology. Research papers and surveys by some of those mentioned above are often useful. A couple of older examples:


MR0064056 (16,219b),
Armand Borel,
Sur l’homologie et la cohomologie des groupes de Lie compacts connexes. (French)
Amer. J. Math. 76 (1954), 273–342.


MR0072426 (17,282b),
Armand Borel,
Topology of Lie groups and characteristic classes.
Bull. Amer. Math. Soc. 61 (1955), 397–432.


One of Bott's surveys *The geometry and representation theory of compact Lie groups* (pp. 65–90) can be found in the volume:


MR568880 (81j:22001),
Representation theory of Lie groups.
Proceedings of the SRC/LMS Research Symposium held in Oxford, June 28–July 15, 1977.
London Mathematical Society Lecture Note Series, 34.
Cambridge University Press, Cambridge-New York, 1979. 


Newer treatments exist, of course, but the most important results are fairly old 
and hard to improve on. The answer to your question depends a lot on what you already know and what sources are accessible, such as the lecture notes by Hiller explaining Borel's approach to cohomology:


MR649068 (83h:14045)
Howard Hiller,
Geometry of Coxeter groups.
Research Notes in Mathematics, 54.
Pitman (Advanced Publishing Program), Boston, Mass.-London, 1982.


