In undergraduate study, a thesis is the defining idea of an essay. We usually think of it as the sentence that states the dominant idea of an essay. In an argument essay, for instance, the thesis directly states the argument the writer makes. It is up to the writer to support the thesis/argument with evidence, etc.
Theme, in contrast, is associated with fiction or poetry rather than nonfiction. Theme is the unifying subject or idea of a work. It is a subject or idea that is repeatedly revealed in a work, thereby unifying the work. In Shakespeare's Macbeth, for example, ambition serves as a theme, as does the difference between appearance and reality. These themes recur throughout the play adding unity to the work.