Theme is what gives the story a personal meaning for the readers.
Without a theme, a story is nothing more than its surface events.
It conveys subtle messages about life and the human condition.
The theme(s) should be there under the surface: don’t hit your reader over the head with them. Be particularly careful if your theme involves something you care passionately about – we should all write with passion but a story is not a political manifesto or diatribe.
The big themes are love and death (Shakespeare knew that better than anyone, hence the enduring popularity of his plays).
Stories with the same theme can be very different. For example: Cinderella, Jane Eyre, and Rebecca all have a ‘love conquers all’ theme.
Your story may have to be finished before you realise what theme you were working with. If so, pay attention during rewrites to make it stronger, more integral, or tone it down.
You can find more on the skills & craft of writing
structure
material
dialogue
narrative & voice
setting
motivation
revision & rewriting
characters
plot
endings
beginnings
the novel
short stories
What some other writers have to say about theme:
Every novel has themes. Most serious authors devote considerable thought to their themes, and, indeed, for many authors the desire to explore or express certain ideas is the originating impulse for writing the novel.
Jane Smiley
Most of the time, I know the theme that I want to write about in advance of creating the rough draft of the novel.
Elizabeth George
The characters and themes that lie hidden within each author are the source of the work that strikes readers as original and real.
Sol Stein
Theme is not the message, not the moral – theme contains an idea but cannot be stated as an idea. It suggests a morality but offers no moral. We must start to understand theme if we ask: ‘What’s it about?’.
Janet Burroway
The dishonest theme is almost always stereotyped: it is the product not of a writer’s observation of and thoughts about life, but of mass opinion and prejudice.
Virgil Scott
Themes, characters, and situations create plot.
May Sarton
The trick is to create subplots that illustrate the same theme but through different situations.
Elizabeth George