The fallacy of appeal to motive occurs when the perceived motivation of a person is treated as a reason to reject that person's position, ignoring that the position could conceivably be correct irrespective of anyone's motive for asserting it.
Here is an example:

Bev and Lev are discussing a proposal before their city council to develop a vacant lot next to the courthouse into a multilevel parking structure.
Bev: "Karl said the proposal doesn't make sense fiscally, and cannot be accomplished in the budget they are claiming. What do you think?"
Lev: "Well, Karl has already declared that he wants that land to be used for putting up a library. So, of course he's going to find fault with the parking proposal. We can therefore ignore his complaint, because it's just intended to clear the way for his own pet project."
Even if Lev is right about Karl's intentions for the property, it does not mean Karl's objections to the parking structure proposal are wrong. Those objections should be examined independently of Karl's motives (real or perceived).
Note that in some instances, the motives of a person are inextricably intertwined with a question of debate. For example, if the truthfulness of a witness is at issue in a court case, and the witness has a demonstrable pattern of lying and also a motive for lying about this particular case, then that motive is relevant. In such a case, it is not a fallacy to bring those motivations into the debate.1 However, in most instances where motives are attacked, the original topic can (and should) be debated apart from presumed motives of that person. In short, if an argument is not fundamentally about a person, then appealing to their motives for argumentative purposes is a fallacy. Critical thinkers don't drag the participants in a debate into the debate itself, making the debate suddenly be about them instead of the original topic.
Very often, when preparing to commit this fallacy, the supposed motive of the target is established by means of the circumstantial ad hominem fallacy.
1Walton, Douglas N. (2001). "Argumentation Schemes and Historical Origins of the Circumstantial Ad Hominem Argument" Argumentation. 15 (2): p. 213.
Image Credit: Jon Polka|THE SPECTATOR under CC BY-SA 2.0