James Watt's calculation of horsepower was based on a horse driving a water pump. The horse walked in a circle at the end of a twelve foot long lever. This means that the horse was walking about 75.4 feet for each revolution. It pushed at about 180 pounds, and 144 revolutions per hour, or 181 feet per minute. This works out to just shy of 33,000 pound-feet per minute.
Horsepower and torque can be calculated from one another via the following simple formula:
HP = ( RPM * Torque ) / 5252
Torque = ( 5252 * HP ) / RPM
Horsepower is of course most commonly used to define the output of internal combustion engines. It is also the standard for measuring the output of steam engines. (Kilo)watts are also common. Torque, on the other hand, is usually shown in foot pounds (ft-lb) or kg/mm, kilograms per millimeter.
In the context of automobiles, you typically show horsepower numbers in terms of brake horsepower/bhp, the amount of power exerted against a flywheel brake, or rear wheel horsepower/RWHP, which is measured with a chassis dyno.
The most common question regarding horsepower in the automotive world is, of course, how to increase it. Without getting overly technical here, the general ways are to increase compression, revolutions per minute (or "RPMs"), and/or to increase displacement, which can be done by increasing bore, stroke, or both. All of these require burning more fuel. Having more bore than stroke (short-travel) provides power sooner (torque) and having a longer stroke (stroker) provides power later in the curve (horsepower). An engine whose bore and stroke are identical is "square".
Generally speaking, torque is greater at the low end, and with a somewhat restrictive exhaust, while horsepower is greater at the high end, with as little exhaust restriction as possible. This phenomena has led to variable exhausts which can control their backpressure. Variable valve timing can also be adjusted to maximize torque during acceleration, and then to maximize horsepower once you are at higher revs. A wise man once said, "Horsepower is what you see, and torque is what you feel."