In the first stanza, the speaker makes a contrast between two occasions when he got angry with someone. What is that contrast?
I was angry with my friend:
I told my wrath, my wrath did end.
I was angry with my foe:
I told it not, my wrath did grow.
"Wrath" means anger. In the first stanza, the speaker is angry with a friend, but "told his wrath," i.e. explained to his friend that he was angry. When the speaker did this, his anger ceased, most likely because he and his friend had a conversation and settled their differences.
In the third and fourth lines, however, the speaker is angry with a "foe," or enemy. He does not share his feelings with the person, and therefore, his anger increases until it bears a metaphorical fruit--an apple--which the foe then bites, and dies from the poison. A poem such as this is too short to be allegorical, but this is clearly an allusion to the Tree of Knowledge (of good and evil).