The speaker of the poem is likely angry with two different people. One is a friend. The other is a foe. No additional information is given about these two people.
I was angry with my friend:
I told my wrath, my wrath did end.
I was angry with my foe:
It is possible that both people are the same, though. I had a student suggest that the friend and foe are the same person. Her reason was that sometimes a person is so angry with a friend, that he/she thinks of them as an enemy until things blow over or forgiveness is given. In "The Poison Tree," it's not too important if it is one character or two, but I'll stick with thinking it is two people for the ease of the explanation.
The important thing is that the speaker talks out his feelings with his friend. His anger subsides, and the two remain friends. Unfortunately, the speaker does not do the same for his foe. Instead, the speaker nurtures his anger and makes it grow and grow. In other words, he holds a grudge against this other person and feeds that grudge with additional feelings of anger and dislike. Eventually those feelings become so powerful that the speaker finds a way to kill his foe. The poem is a good warning to readers about the dangers of anger and what those feelings can turn people into.