It's not from the Quran, its a Hadith.
According to Abu Hurayrah a man asked the Prophet (S) for an advice. The Prophet (S) replied: don't get angry. And he said it three times.
From my old readings all I remember is that it was just a stand alone hadith just like I pasted. I'm sure there might be some context to it. But it's best to learn these things from an Imam.