The most important difference between a subscript and a superscript is where it is placed. A subscript is placed below the main line of text. Superscripts are located above the main line.
Subscripts and superscripts add information to the main bulk of the text, but both are used for different reasons. Subscripts are most often used in chemistry to denote chemical compounds. They can also be used to include variables in some types of math. Subscripts can be numbers, letters, symbols or full words. Sometimes, subscripts are used in written texts.
Superscripts are used often in books, both fictional and non-fictional, to provide the reader with more information. The Chicago Manual of Style requires superscripts as part of its footnote and endnote system of citation. In this case, superscripts are usually numbers, though they can be letters as well. Superscripts are also used to denote power in math, so two squared would be the number two with a smaller number two as a superscript.
Both subscripts and superscripts almost always appear to the right of the noted text, although in some complex formulas and math problems, they do appear to the left. Subscripts and superscripts are also smaller than the bulk of the text.