How do we estimate $10^{23}$ stars in the observable universe? Now, I read somewhere, that there are $10^{23}$ stars in the observable universe. How did scientists estimate this?
 A: Have a look at this article. It gives the number as $10^{24}$ rather than $10^{23}$, but it's such a vague estimate that a factor of ten is within the expected error.
The number is the number of stars in the observable universe i.e. within 13.7 billion light years of Earth at the time the light we see today was emitted. Note that visible means visible to a sufficiently high powered telescope. The number of stars you and I can see by looking up at night is actually only about 5,000.
The number of stars is obtained by multiplying the estimated number of galaxies (170 billion) by the average number of stars per galaxy (around a trillion). But both figures are such rough estimates that even a factor of ten is probably too small an estimate of the error.
A: An alternative method to John's answer is to look at the total number of atoms in the observable universe. Thanks to measurements of the cosmic microwave background, we have a fairly precise estimate of this number. Indeed, we know that ordinary matter makes up about 4.9% of the energy content of the universe. In this previous post, I calculated that this corresponds to about
$$
N_A = 7\times 10^{79}
$$
atoms in the observable universe. 75% of these atoms is hydrogen, and nearly 25% is helium, so the average mass of an atom is 
$$
m_A \approx 0.75\,m_\text{H} + 0.25\,m_\text{He}\approx 2.9\times 10^{-27}\;\text{kg}.
$$
Next, we need an estimate of the average mass of a star. If our own solar neighbourhood is representative, we find according to this article an average stellar mass of about 1/4 the mass of the Sun:
$$
M_\star \approx 0.25M_\odot\approx 0.5\times 10^{30}\;\text{kg}.
$$
So an average star contains about
$$
N_{AS} = M_\star/m_A\approx 1.7\times 10^{56}
$$
atoms. Combining this with the total number of atoms in the observable universe, we arrive at an estimated number of
$$
N = N_A/N_{AS} \approx 4\times 10^{23}
$$
stars. Of course, we assumed here that all matter is locked up in stars, which is not true: in fact, according to this article about 75% of baryonic matter consists of diffuse intergalactic gas. And according to this post, only 6% of baryonic matter is within stars. In that case, our estimated number of stars lowers to $\approx 2\times 10^{22}$.
(Thanks to Ben Crowell for the comments)
