Properly understood, it consists of saying that someone's argument is wrong because of something about the person rather than about the argument. Thus, for example, merely insulting another person in the middle of otherwise rational discourse does not necessarily constitute ad hominem, as this term has usually been taught. Moreover, it is not necessary to insult the person whose argument is attacked in order to commit the ad hominem fallacy. For example, one could say "Ronald Reagan is a Republican; therefore, the argument he just gave is wrong." That is fallacious because the argument should be judged on its merits independently of who stated it; it is ad hominem according to the definition above, and Ronald Reagan would probably not consider it insulting to be called a Republican. Rather, it must be clear that the purpose of the characterization is to discredit the person offering the argument, and, specifically, to invite others to discount his arguments. To be sure, however, the term is often used as a synonym for "insulting one's opponent in the middle of otherwise rational discourse." But this is not how the meaning of the term is typically introduced in logic and rhetoric textbooks, and logicians and rhetoricians are widely agreed that this use is incorrect.
Three traditionally identified varieties include ad hominem abusive, ad hominem circumstantial, and tu quoque.
Ad hominem abusive usually and most notoriously involves merely (and often unfairly) insulting one's opponent, but can also involve pointing out factual but damning character flaws or actions. The reason that this is fallacious is that--usually, anyway--insults and even damaging facts simply do not undermine what logical support there might be for one's opponent's arguments or assertions.
An example: "I obviously don't need to reply to Jones's arguments; everyone knows that he's a convicted felon."
Ad hominem circumstantial involves pointing out that someone is in circumstances such that he or she is disposed to take a particular position. Essentially, circumstantial ad hominem constitutes an attack on the bias of a person. The reason that this is fallacious is that it simply does not make one's opponent's arguments, from a logical point of view, any less credible to point out that one's opponent is disposed to argue that way.
For example: "You needn't bother to listen to the trial arguments of the tobacco companies; after all, they're just defending their own multi-million-dollar financial interests."
Ad hominem tu quoque (literally, "at the person, you too") could be called the "hypocrisy" argument. It occurs when a claim is dismissed either because it is inconsistent with other claims which the claimant is making or because it is inconsistent with the claimant's actions.