There are about 2 trillion galaxies in the observable universe. This is the best estimate that can be asserted based on today’s technology. However, scientists expect the numbers to grow bigger as the telescope technology gets more sophisticated. In fact, it is practically impossible to do the counting. The numbers are mostly the result of a careful extrapolation work in which astronomers use the data of a particular region and try to generalize it on wider areas. The 2 trillion estimate has been proposed by researchers in an article named The Evolution of Galaxy Number Density at z < 8 and its Implications, published in October 2016.
Up until 1924, the common knowledge was that the Milky Way was itself the whole universe. In that year, Edwin Hubble discovered that the spiral nebula Andromeda was indeed a distinct farther galaxy and that the universe is much larger than expected. In 1929, Hubble proved that the universe is not only large, but also expanding.