There is a legal difference in ownership as well. A townhome is usually owned in fee simple. In other words, the owner of a townhome has property rights that extend to the yard around the townhome and the air above it. By contrast, a condominium owner's property rights only extend to the walls of the structure.
Ownership of both townhouses and condos are often accompanied by association fees which cover shared maintenance of extra amenities like pools and tennis courts as well as providing for general upkeep of shared property such as the roofs of buildings or the walkways between buildings.
Some of this info might be area specific so be sure to check what is applicable to you.