Residual sugar (or RS) is the measure of the amount of sugar solids that remain unfermented in the wine, plus any sugar added when making a sweet wine, or a 'dosage' added to a sparkling wine. Residual sugar concentration is expressed in grams per litre (g/L) or as a percentage of weight to volume. For example, a wine with 0.2% residual sugar contains two grams of sugar in a litre of wine.
Residual sugar is usually measured in grams of sugar per litre of wine. Even among the driest wines it is rare to find wines with a level of less than 1 g/l, due to the unfermentability of certain types of sugars, such as pentose. Example: Sacred Hill Rifleman's Chardonnay 2007 has approx 2.3g/l. By contrast, any wine with over 45 g/l would be considered sweet, though many of the great sweet wines have levels much higher than this.
For example, the great vintages of Chateau d'Yquem contain between 100 and 150 g/l of residual sugar. De Bortoli 'Noble One' Botrytis Semillon can have anywhere from 150 - 210 g/l of residual sugar. Paul Jaboulet's Muscat Beaumes de Venice 2007 has 252 g/l of residual sugar. The sweetest form of the Hungarian Tokaji wine can contains over 450 g/l, with exceptional vintages registering 900g/l.
Such wines only avoid the cloying taste associated with such elevated levels of sugar by carefully developed use of acidity. This means that the finest sweet wines are made with grape varieties that keep their acidity even at very high ripeness levels, such as Riesling and Chenin Blanc.
Residual sugar typically refers to the sugar remaining after fermentation has stopped (naturally or controlled), but it can also result from the addition of unfermented 'must' (a technique practiced in Germany and known as sussreserve) or ordinary table sugar. The latter technique is generally used on low quality, often non-grape wines, and in most winemaking regions is banned altogether. So regardless of a wine tasting sweet or dry, just about every wine contains a small amount of unfermented or residual sugar.