Dramatic irony, simply put, occurs when there is a contrast between what the audience knows about a particular character's situation in the present of future, and what the character him or herself understands their situation to be.
Okay, convoluted definition aside, dramatic irony is used all the time for a good laugh or a heartbreaking revelation. Some perfect examples:
Dramatic irony is at its most effective when it forces characters to adopt positions they wouldn't otherwise - such as in Mike Nichols's The Graduate, when Benjamin goes on a date with Elaine, whose mother he's sleeping with. He acts boorishly the entire time, to the point of making her cry, even though he really likes her.
Although dramatic irony is closely tied to situational irony (where a seemingly predictable outcome turns out a different way) and verbal irony (when a person says something that is meant to convey the opposite feelings or contrast the obvious), they are significantly different in that dramatic irony is only set on its course when the audience is let in on a secret that the characters are not.
BEST EXAMPLE OF DRAMATIC IRONY EVER
The young Oedipus unwittingly kills his father (the king of Thebes) and marries his mother. When his brother-in-law Creon suggests that Oedipus killed the king of Thebes in order to become king, Oedipus is outraged, and tells Creon, "A fool is he who thinks he can sin against his kinfolk and not suffer the wrath of the Gods." Beautiful.