The ability to understand that other people have different ideas and information about the world from one's self emerges in most kids by around four years old. This ability that most of us share is really nicely illustrated by this video. According to psychologist (and brother-of-Borat) Simon Baron-Cohen, kids with Autism Spectrum disorder have a much harder time with tasks such as these. A recent study in Frontiers in Psychology found that empathy and the ability to understand irony are correlated in kids.
Makes sense. Irony is a disconnect between what a person says and his or her inner
state. By around eight years of age most kids can 'get' that disconnect. The authors point out that these are both areas that are difficult for people with ASDs. Empathy and reading irony both require projecting one's self
into another person's inner experience; Theory of Mind. In the case of irony, one has to do that while swimming upstream, as it were, against the current of the literal message. I have noticed in my practice how hard and frustrating it is for kids with ASDs to read and irony.