10^87 is too many (this was perhaps an older estimate before Planck 2015 data). It should be closer to 10^80.
The method for finding that value is to first note that the density of the universe is close to the critical density, which we know from measuring how the scale factor of the universe changed with time, and also by measuring the geometry (close to spatial flatness). Then we invoke the fact that the universe is homogeneous on large scales. So we can multiply that density by the volume of the observable universe to get the total mass. Finally, multiply that result by the fraction of the density of the universe that is in the form of baryons. Since most of the of the universe is hydrogen (which is just protons), we can get the number of protons that way. The number of electrons will be close to equal to the number of protons since the universe is electrically neutral.
(Aside: To be more accurate we can also account for the neutrons in the heavier elements, but since those are a smaller fraction it matters little to the result, especially when also considering the other uncertainties in the numbers going into this derivation, especially the value of the Hubble constant.)
Let's try the calculation ourselves.
Using H = 68km/s/Mpc, we get the critical density of 8.7x10-27 kg/m3. Note the critical density depends on H squared, so uncertainties in the exact value of H matter a lot.
Using Lambda-CDM with H=68km/s, Ωm = 0.31, and Ωtot = 1, the comoving volume of the observable universe is about 12000Gpc3. Again the value of H matters here. The comoving volume is bigger if the Hubble constant is smaller. This is nice actually because it somewhat cancels the effect of uncertainty in H on the critical density.
Multiplying the density by that volume, we get a total mass of the observable universe to be about 3x1054kg.
Now we must account for the fraction which is baryons. Dark energy is 69% of the universe's mass/energy density, and dark matter is 26%. Baryons are only 4.9%, plus or minus 0.1%!
Multiplying 3x1054kg by 4.9%, and dividing by the mass of a proton, we get 9x1079 protons in the universe. Let's call it 1080 as an order of magnitude estimate.
Yes, there are various prediction that protons themselves are unstable and might decay. But it has not yet been observed, and the fact that it hasn't been observed helps place a lower limit on how long the half-life of the proton must be. It is something ridiculous, like 1034 years! We can do some math and calculate how big of a pool of water you would need to expect to have one proton in it decay per year, or whatever, for various estimates of the possible proton half-life. It ends up being very big, but not completely impractical. In fact there are a number of projects in the works to try to detect it, assuming it happens at all. For example, the new Japanese detector Hyper-Kamiokande:
[youtube]JFOE3D2z7LM[/youtube]
That's exactly right.




[/center]
[/center]

[/center]