A novel, play or poem that is didactic aims to teach us something. What? Well, anything, really. Didactic works often have morals to impart or are written to teach us something about religion, philosophy, history, or politics.
Examples of didactic literature include Aesop's Fables. Novels written for women in the 18th and 19th century were also often didactic, kind of like fictionalized conduct manuals. Jane Austen's Northanger Abbey, for example, is often thought of as a didactic novel since it teaches readers how to act like a good young lady—and read like one, too.