Have you ever had someone take a photo of you and a friend, only to find out later that they cut off the tops of your heads? It looks ridiculous, and if someone’s head 'sticks out' of the composition, your photo is ruined. In other words, it’s not hard to imagine where the don’t-crop-people’s-heads rule came from. When you are working with people and portraits you will soon learn that there are good ways to crop people, and others that are not so good. Cropping heads is at the top of the naughty list. Don’t do it!
Except that, sometimes, cropping heads can be highly effective.
When can you break this rule-of-rules? When you've got in close—really close—to your subject. If your composition is focused only on somebody’s face, it can improve the shot to crop in close.
Don't be afraid to break the rule and crop in close and slice something off of the top, bottom, or sides of the head when the features of the face are the focal point of your composition. The reasoning is this: if you’re going to get in close, get in really close. By filling the frame completely with someone’s face it can make cropping her or his head unavoidable, but it also doesn’t look unnatural.
The key is to decide whether your composition is mainly about the body, upper body (shoulders and above), head, or just the face. Each type of shot has a different purpose, and only the face shots will look natural if you decide to crop the head. Otherwise it merely looks like you failed to plan your shot.
But in-keeping with the adage that if you're going to break the rules, break them properly, if you are going to crop into somebody’s head, make sure that you do it properly. A composition where only a thin sliver of someone’s head is cut off looks accidental. If you go even closer and cut them off across their forehead, the composition looks a lot more powerful, and at least nobody is left wondering whether or not you did it by accident!
More unusual ways of looking at things, remembering rules, and then breaking those rules, are in my lovely book, The Rules of Photography and When to Break Them. It's available as an e-book and in a dead tree version (UK, US).