As is mentioned in many outreach lectures, the Gemara in Berachos 32B says the following:
Hashem said to her (Israel): My daughter, 12 mazalos did I create in the rakia, and for each one I created 30 hosts. For each host, I have created 30 legions, for each legion I have created 30 cohorts, for each cohort I have created 30 maniples, for each maniple I have created 30 camps. To each camp I have hung365,000 myriads (10,000s) of stars corresponding to the days of the solar year. All of them I created for your sake.
This Gemara seems to be telling us how many stars there are in the rakia (which I have found is best defined as the view of the sky from the Earth). It is obviously rounding the number off because it was well known when this was written that the solar year is a bit longer than 365.25 days.
If you multiply out the groups, you get a total of 1.06434X10^18 stars. As many point out, this is within a few orders of magnitude of the current scientific estimates of the number of stars in the visible universe.
I thought I would add a bit to this idea as follows:
First, according to this Gemara, it is only mentioning the 12 mazelos of the zodiac. The zodiac covers a 16 degree band across the sky. Therefore for the total number in the whole sky, you must compute the surface area of the 16 degree band and apply the stars-per-degree^2 to the rest of the celestial sphere. This is pretty straight-forward, and one finds that the whole sky (assuming the same star density) yields 7.6476 X 10^18 stars.
Now, according to sceintific studies, there are anywhere from 10^21 -> 7 X 10^22 stars in the observable universe. These numbers are computed by taking a small strip of the sky, and counting the number of galaxies in that strip, and then assuming each galaxy has an average number of stars similar to our own Galaxy. They then use this to estimate the whole universe. This can be problematic for a couple for reasons.
First, besides the fact that we don't know how many stars are in earlier galaxies, we also don't know if we are seeing different galaxies to begin with. This is because through the bending of light around other galaxies, sometimes you can see two or more images of the same galaxy. This is referred to as an "Einstein Ring." Now, we can detect these, but it is entirely possible that there are other lensing effects we can't immediately detect. This phenomena reduces the number of galaxies in any view of the sky. Also along these lines are topological concerns. There is debate about the shape of the universe, but it seems that it is flat. This means that if the universe is finite (which is accepted) then the universe behaves like a pacman game in that if you fly too far in one direction, you will loop around and come back to where you started. With this in mind, it is possible that some the the most distant galaxies we see are actually the same galaxies we see elsewhere.
Second, assuming each patch of sky is equal to the others is highly extrapolative. A perfect example of why is found here. In this article it describes a huge, vast empty "hole" in the universe devoid of stars and galaxies that was not noticed previously. How many other holes there are we may never know for sure. These "holes" reduce the estimated number of galaxies in the universe even more, and if there are enough of them, could invalidate the extrapolation of one patch of sky to the next.
With all this in mind, the difference of 7 X 10^18 and 7 X 10^22, while enormous, is not conclusive. (For a quick example, say we find out that most old galaxies only have about 10^9 (1 billion) stars and that there are really only about 10 billion unique galaxies, then the number comes to 10^19.)