The definition for literally--adverb--is: in a literal manner or sense. Specifically, it is defined as "word for word," "not imaginatively, figuratively, or freely." It also means "actually; in fact," "seemingly, but not really."
Very few occasions occur when literally is used correctly. However, more people seem to be using this term incorrectly and are possibly unaware. In fact, this term is commonly misunderstood.
For example, a person would typically say, "I literally hit the ceiling." Of course, "hit the ceiling" would be considered an idiom that expresses one's frustration. However, when a person says that he or she "literally hit the ceiling," does it really mean that that person's body was actually thrown up and into the ceiling, causing some damage to the body? If that isn't the case, a more appropriate sentence can say: "I just about hit the ceiling," or "I hit the ceiling."
Another example is when a person says something such as: "My head literally exploded when my boss ignored my ideas." Now, did this person's head actually explode into hundreds of pieces all over the office? Of course not. It simply means that the person was so angry because his or her ideas were ignored by the boss that he or she was on the verge of snapping at the boss.
It is okay to use literally, as long as it isn't used with an idiom. Unless, of course, that certain situation is actually happening, use this term wisely.