The theme is the kernel of the story, the central message you want to convey to readers. If you write without a unifying theme, your story will lack cohesion.
Here are some examples of themes: Beauty and the Beast - character is more important than appearance; The Hare and the Tortoise - slow and steady wins the race; The Ugly Duckling - hold onto hope, there's always a beautiful tomorrow.
Themes are built on needs and problems. For example, if you're writing for teens, some needs you can address would be your readers' search for identity and the pressures they face from friends and schoolmates. You could then build your story on themes like finding oneself through facing and overcoming challenges, or making choices based on one's personal convictions.
The length of your story will determine the number of themes it can successfully carry; if you're writing a short story, it is wise to focus on just one or two themes. In a full-length novel, you can have a strong central message with a few secondary themes supporting it.
Weave your storyline round your central theme. A short story will often have a simple plot based on a single theme. A longer novel can have a more complex plot, with subplots to add depth and interest.