The word 'millions' is referring to people. 'As many years' is a phrase which in this context means a very long time - not literally millions of years since people haven't been around for millions of years.
Hence the sentence is saying that the river in question (the Ganges perhaps?) has made a significant impact on the peoples whose lives it has touched, for as long as there have been people to be touched by it.
Student or Learner