The early work of Borel showed in effect how to interpret the cohomology algebra of a flag variety as the coinvariant algebra associated to the Weyl group, which affords the regular representation of
$W$.(A useful exposition, if you can locate it, is the 1982 Pitman Research Notes Geometry of Coxeter Groups by Howard Hiller, though the account of Coxeter groups in general is too sketchy.) This has been understood from various viewpoints such as compact groups and complex semisimple Lie groups, with further combinatorial development by Bernstein-Gelfand-Gelfand and Demazure. By now there is a lot of related literature, including connections with the Springer Correspondence.
On the other hand, the Iwahori-Hecke algebra associated to the Coxeter group
$W$ is a deformation of the integral group ring, therefore also close to the group algebra and representation theory of
$W$. A fundamental source is the 1979 Invent. Math. paper by Kazhdan and Lusztig here. But as far as I know the answer to the original question (how is the cohomology ring related to the Hecke algebra) is that the two are only indirectly related.
P.S. Bischof has pointed to some of the rich developments following the papers by BGG and Demazure, but I'm not enough of a specialist to know which references are most relevant here. One important direction I should mention involves work by Kostant and Kumar on what they call the "nil Hecke ring", motivated partly by wanting to work with analogues of Schubert varieties in the infinite dimensional Kac-Moody framework. See in particular: Bertram Kostant and Shrawan Kumar, The nil Hecke ring and cohomology of G/P for a Kac-Moody group G,
Adv. in Math. 62 (1986), no. 3, 187–237.