This is a community wiki post. Anybody with more than 100 reputation can edit it. You may also post your own answer. I get no reputation if you vote the question up or down, however, please vote up if you think it is good.
This is a community wiki post. Anyone with more than 100 reputation may improve it. I get no reputation points for votes.
Specific gravity (SG) is a measure of density. By convention, pure water has a SG of 1.000. Substances denser than water have a higher specific gravity. For example, if a beer has an OG of 1.050, it is 5% heavier than the same volume of water.
The stuff that makes beer heavier than water is (mostly) sugars. By measuring the specific gravity of wort or beer you are implicitly reading its sugar content.† Measurements of Specific Gravity can only guess about the sugar content, since other things in solution, like alcohol, change the sample's density.
PPG & Potential
Sugars like malt extracts have a "points per pound per gallon" (ppg) rating. PPG is calculated by combining one pound of extract and enough pure water to make one gallon. The extract's rating is then the specific gravity of this solution. Usually, the supplier of a malt extract will list its ppg.
For example, suppose you have a pound of honey and you want to calculate its ppg. Mix the honey and enough water to make a one gallon solution. A hydrometer reading a SG of 1.026 means the honey's ppg is 26.†† Sometimes, this is written as a "potential" of 1.026.
Note you can not add a pound of honey to a gallon of water. The honey takes up volume by itself. The total solution must be one gallon for a correct measurement of potential.
Now we can calculate the SG of one pound of extract in a one gallon solution. To arrive at the SG of an arbitrary weight of extract in a one gallon solution, multiply the number of pounds of extract by it's ppg. If your volume is larger, say five gallons, divide by the volume.
For example, 7.3 pounds of malt extract with a ppg of 34 mixed to make 5 gallons yields a wort with specific gravity 1.050.
Like extracts, grains and adjuncts have a ppg rating. To get a grain's potential, the supplier performs what is known as a congress mash where the malt is ground into flour and steeped at a certain temperature for a set length of time. The gravity of the resulting wort is measured to arrive at the potential. This method determines the maximum potential of the malt.
A congress mash would produce beer that is astringent and cloudy. Tannins from the husks and proteins in the kernel would carry over, making for a nasty brew. Brewers instead crush grain and sacrifice a little malt potential.
The amount of potential lost to various brewhouse techniques (like crushing instead of grinding) is called efficiency. Typically a brewer accepts efficiencies between 60 and 80 percent of the maximum potential produced by a congress mash. If a brewhouse produces a wort of 1.045 with malts of calculated maximum potential 1.064, the efficiency is 70%. (45 / 64 = 0.70)
Taking this into account:
Adding It All Up
Combining malts and extracts with different potential is also simple. Calculate the resulting specific gravity of each individually, then sum the results.
† Other scales, like Plato and Brix, are explicit measurements of sucrose content in a known volume of water. They measured SG by combining quantities of sucrose with water to a known volume, for example, one liter. They then measured the refractive index of the solutions. Because of this method, these scales are measurements of known quantities of sugar. Also understand that the refractive measurements were calibrated with sucrose or fructose -- generally not found in beer. While these sugars are very similar to maltose & dextrose, the scales are just a little off. Be consistent with your measurement methods and it won't matter much.
†† If you don't want to waste an entire pound of extract, two ounces honey by weight and pure water topped off until you have two cups by volume will give you the same concentration.