A theme is a dominating influence in literature whether it is in a novel or in poetry. It often conveys universal ideas which revolve around life and how it affects actions in general. It can be abstract in nature and may be implied rather than actually stated, especially in poetry. It allows the reader to follow the thread of a piece of work without becoming too involved in the subject matter itself. Poetry can be complex and there may be more than one theme. However, the main theme is revealed in the enduring lines of the poem. The subject matter of a poem is what creates the foundation from which to establish the theme. As an example, consider Edgar Allan Poe's Annabel Lee.
This poem is about a man who is either totally devoted or completely delusional and narcissistic. He lacks the ability to think logically and finds nothing disturbing in the intensity of his feelings or her presumed feelings which "the winged seraphs of heaven coveted..." The narrator is removed from reality and makes it understood that his love is so deep that even her death cannot "dissever my soul from the soul of the beautiful Annabel Lee." His devotion and her assumed devotion are the subject matter of the poem and the fact that he considers himself to have defied death even though she died "many a year ago" shows that the poem is about the effects of death and the way different people deal with it or perhaps never actually come to terms with it and spend their days consumed by their love unable to function as an individual. Therefore, the themes include love, death and extremes of behavior and it is the actions or words of the narrator that expose these themes.
Subject matter of a poem is the most straightforward part of your question to answer. Most of the time, the title of the poem is a reader's largest clue as to what the poem is about exactly. For example, if one were to read Beatrice Janosco's "The Garden Hose", and ignore the title, the reader would think that the subject matter of the poem was about a snake:
In the grey evening
I see a long green serpent
With its tail in the dahlias
It lies In loops across the grass
And drinks softly at the faucet.
I can hear it swallow.
Therefore, the title shows that the poem is actually a metaphor poem and actually about a garden hose.
As for themes in poetry, a theme refers to the message, general idea, or what the author wishes to teach/say to readers about morality. Themes exist as a continual undertone or overtone of an entire piece. Themes typically speak to social/cultural issues and/or life in general (human nature/behavior).
It is very common- and easy- to confuse a subject and theme of a literary work, particularly poetry. However, these literary terms have universal meanings across different genres and types of texts. Thus, it is easier to begin with a basic understanding of both literary terms.
Subjects are the topics that are being explored in a text. They serve as the foundation for the text, and are essentially what themes are built upon. For example, an author can write about Love, as a subject, and develop multiple themes about love within the text's message. A theme, on the other hand, is the underlying message of the text. The theme will typically display the author's opinion about the subject. If you reference the example of love from before, an author could build a theme of "Love conquers all hate". This theme involves the subject of love, gives the author's opinion of love, and shares an underlying message for the story.
When reading poetry, it is best to analyze what overall topic is being discussed throughout the poem. By finding the overall topic that is discussed, the reader will have also found the subject of the poem. Sometimes, as another poster stated, readers can find the subject by reading the title. Unfortunately, this method is not universally applicable. Further, once the subject is understood, readers can find the theme by simply analyzing the perspective, tone, and message or moral given about the subject within the poem. Below, I use the poem, "Not My Businless", by Niyi Osundare, to illustrate what I stated.
The title implies that the poem's subject is minding one's business. However, this is not the subject at all. The actual subject of the poem is collective responsibility, and a protest to the unjust ways of the world that the narrator knew. Throughout the poem, the narrator explains varying levels of atrocities happening to his neighbors. Each time, the narrator's retort is the same, not my business, so long as the yam is not removed from my hand. The subject is really shown at the end of the poem when the narrator states,
And then one evening As I sat down to eat my yam A knock on the door froze my hungry hand.
The theme is inferred, based on the harsh reality that the narrator finds at the end of the poem. A possible theme could be "individuals must be their brother's keepers", or "silence does not ensure safety".