A facepalm is the physical gesture of placing one's hand flat across one's face or lowering one's face into one's hand or hands. The facepalm is a gesture which is common in many cultures, and even sometimes seen in chimpanzees!
Although a facepalm is usually used to express frustration or embarrassment, in the context of a surrounding conversation it can also be used to express other emotions, such as disgust or dismay. A facepalm is often a reaction to a momentary lapse in common sense, judgement, or logical behaviour. It can be directed towards another person – i.e.: a non-verbal way of saying "I can't believe you just said/did that …" – or used in a self-deprecating way to make it clear to others that you're aware that you've said or done something stupid.
Facepalm first appeared about five years ago, and has steadily gained ground as a popular term in Internet culture.