"An obscure branch of magic, but a highly useful one."
-- Severus Snape (OP24)
occulto - (Latin) to hide, conceal, cover (the English word 'occlude' comes from this root, as well as the modern astronomy terms about one celestial body hiding another from view)
mens - (Latin) mind
Occlumency is the art of magically defending the mind against external penetration, sealing it against magical intrusion and influence - the defensive counter to Legilimency. A practitioner of Occlumency is referred to as an Occlumens.
Occlumency is a necessary prerequisite to defeat a Legilimens' lie-detector abilities without suspicious behaviour such as avoiding face-to-face contact and eye contact. Elementary Occlumency involves clearing the mind of thought and emotion, so that the Legilimens can find no emotional ties to memories that the target wishes to conceal. Simple resistance to attack requires similar skills to those needed to resist the Imperius Curse. In its more advanced form, Occlumency allows the user to suppress only feelings and memories that contradict what the user wishes a Legilimens to believe, thus allowing the Occlumens to lie without self-betrayal (OP24).
Severus Snape is a particularly skilled Occlumens, since he has managed to survive as a spy among the Death Eaters, under the nose of Voldemort, a noted skilled Legilimens who has good cause to be suspicious of Snape's loyalty. Dumbledore knows enough Occlumency that he can teach it if he wishes to (OP37). Harry Potter has learned some of the basic theory of the art, but ordinarily has had a poor success rate in defending himself against attack. However, much of this might be attributed to the high stress he was under during his O.W.L. year and lack of proper practice.