The skills are first mentioned in Order of the Phoenix, (though Harry gets the impression before that Snape can read minds) wherein Snape is instructed by Dumbledore to give Harry lessons in Occlumency. Whether as a result of negligence in Snape's instruction, or poor aptitude on Harry's part, Harry never made any progress in the skill, and as a result he was lured by Voldemort through a carefully calculated vision he falsely believed to be real. Only once has Harry managed to overcome Snape with the use of Occlumency, in Order of the Phoenix. During the lesson, Harry notices that the Dementors become fainter and Snape becomes clearer.Bellatrix Lestrange, Draco Malfoy, Narcissa Malfoy and Barty Crouch Jr may also have some skill in Occlumency, since Bellatrix was said to have taught Draco to shield his thoughts from Snape and Narcissa's treachery is not detected when Voldemort asks her to check Harry's pulse after he has seemingly killed him.
The key to good Occlumency, as described by J. K. Rowling, is to be capable of hiding or suppressing one's emotions. This is why Snape and Dumbledore are accomplished Occlumens, because they are able to hide what they are truly feeling, and Draco, like his parents, is able to suppress his emotions. Harry had trouble mastering Occlumency because he embraced his emotions. Maturing allowed him to control them.Legilimency and Occlumency are not part of the normal curriculum at Hogwarts, and most students would graduate without learning them. They seem to be considered a more advanced form of magic.