If there is more than a certain critical amount, the gravitational attraction between the galaxies will slow down the expansion. Eventually they will then start falling towards each other and will all come together in a Big Crunch. That will be the end of the history of the universe, in real time.