Pot calling the kettle black

The pot calling the kettle black is an informal fallacy also called Tu quoque.Tu quoque is Latin for "you also".  
Another name is appeal to hypocrisy. 

It happens when a person is guilty of the very thing of which they accuse another.

A fable, perhaps by Aesop, has a mother crab and its young, where the mother tells the child to walk straight, and is asked in return to demonstrate how that is done. Folklore and Fable vol.XVII, New York 1909, p.30 

A present-day example:

Peter: "It is morally wrong to use animals for food or clothing".
Bill: "But you are wearing a leather jacket and you have a roast beef sandwich in your hand! How can you say that using animals for food and clothing is wrong?" 

It is a fallacy because a person's actions or character do not affect the logic of the argument.

References

Category:Logical fallacies