People have been asking this question for a long time. Back before telescopes were invented by a Dutch eyeglass maker, Hans Lippershey in 1608, the number of stars was what we could see with our naked (or unaided) eyes. This number is estimated as no more than 10,000 stars. This number varies according to how you count them, as only 1/2 the stars are visible from a single place on Earth and then only 1/2 the time. You can't see stars through the Earth and during the daytime!
After the telescope was invented, the number of stars we could see increased as we could see more of the fainter stars we couldn't see before. This number is probably about 1,000,000,000 (1 billion), but no one could actually count them all. Instead, Jérôme Lalande published the Histoire Céleste Française in 1801, which contained an extensive star catalog. The observations made were made from the Paris Observatory and so it describes mostly Northern stars. This catalog contained the positions and magnitudes of 47,390 stars, out to magnitude 9 (very, very faint), and was the most complete catalog up to that time. This would give only about 100,000 stars of magnitude 9 or better if the Southern stars could be counted.
What we call the Milky Way was known long before telescopes, but it was not known that is was made up of stars. The name Milky Way is from a Greek fairy tale involving a goddess and her milk. After telescopes became commonplace, following the efforts of Galileo, it was soon realized that the Milky Way is an unusually dense collection of stars, all lined up.
When people first started looking through a telescope, they noticed fuzzy spiral objects which were grouped with other such "nebulae" and with star clusters. These were at first considered interesting curiosities in the sky, but not to be confused with really interesting things such as comets.
Edwin Powell Hubble (1889-1953) demonstrated that most "nebulae" are objects outside our galaxy, using the 100-inch telescope at Mt. Wilson (in 1924). With this powerful instrument, he was able to measure the distance to the Andromeda nebula itself, observing stars within that neighboring galaxy. Thus, the enormous distance to this neighbor became clear: Hubble gave it almost a million light years. As it turned out, this was still quite a bit short of the truth. The distance is greater than 1.5 million light years. With this greater distance, the information coming in from the Andromeda could be interpreted correctly, and it turned out to be a sister galaxy, quite similar to our own.
We now know that there are about 300,000,000,000 (300 billion) stars in the Milky Way Galaxy alone. The Milky Way is larger than average, an average galaxy has about 100 billion stars.
In 2012, Hubble scientists produced the Hubble
Extreme Deep Field image. The area searched was an area of clear sky that was less than 1/100th the area of the full moon.
In that little rectangle, scientists were able to count
over 10,000 galaxies. If this area is typical, there are 100 billion
galaxies in the universe. An average galaxy has 100 billion stars, so
there are 10,000,000,000,000,000,000,000 stars in the
universe (or 1022
in scientific notation).