A smartmouth is a person who produces many, many acerbic, witty, sarcastic, surprising, astute, sardonic, rude, or shrewd remarks in response to a variety of circumstances. Some variations on this title include "smart alec" and "smart ass". Simultaneously, a smart mouth (two words here, in my assessment: a noun modified by an adjective) is the actual mouth of such a person, the mouth which produces said remarks; i.e. "you've got a smart mouth on you". You can also use the verb "to smartmouth", which indicates the act of making such remarks. There are a number of variations on this as well, the most common of which seems to be "to smart off".
The OED says that the word "smart" means both "To be a source of sharp pain; to be acutely painful" and "Of a whip, rod, etc.: Inflicting or causing pain; sharp, biting, stinging." This seems to be the source of the term; a smartmouth certainly can sting. One might then also note the possible relation to the phrase "smart as a whip".
Smartmouths are generally thought of as pretty rude, especially by their parents. They will receive such scintillating reprimands as "don't be fresh", "don't sass back", or "don't get smart with me". The smartmouth him- or herself, in contrast, will usually just think of themselves as trying to be funny, or, surprisingly enough, smart. This can start some nasty fights if you aren't careful.
A smartmouth is not necessarily a good or bad thing to be; there is a diffference between being a smartmouth and being obnoxious. Smartmouths can be judged on the worth of their remarks. This is necessarily going to be very subjective, but that's not really a problem. The line between wit and rudeness varies from person to person; assess it for yourself.