Basically anytime you decide to purge.
While euphemistically called "purging", it is clear that genocide is a Very Special Kind of Evil for those in the Stellaris galaxy. I have to admit I didn't think much of it. Early game I didn't have too many good means of controlling ethics divergence, and when I got it to reach a negative number it was in the low single digits. To help control factions I decided to get rid of the disobedient pops. The plan was simple: purge pops that disagreed with my ethos, and let the non-deviant ones repopulate in their place. Simple. It worked, but since then everyone has hated me, but nobody has ever tried to mess with me because I've been at Fallen Empire levels of power for at least a few centuries (it's worth noting that I have only ever fought one defensive war).
While purging opinion penalty does decay over time, the penalty is -1000 and decays at 1 a year. While I don't think Stellaris has a hard end point and you can theoretically keep playing forever, I don't believe many players will want to play for a thousand years just to say they say the penalty fully decay. Because of how even rivalries and insults (-200 and -100 respectively) can close off players to diplomacy, a -1000 penalty essentially ensures that any kind of diplomacy is over. As I've discovered, this penalty even applies to enlightened protectorates who become vassals.
However, what's truly evil is when you wage genocidal wars. You see, early on my gameplay was a cycle of war, vassalize, integrate. repeat, but eventually my neighbors became too big to vassalize and I had realized that expansion was driving up my technology costs too high. Because I still wanted to weaken other empires, I used the cleanse planet wargoal, which essentially purge a planet of all pops at the end of a war instantaneously. I've found that you can purge 3-5 planets per war, though the victim will generally be able to colonize 2-3 planets in-between wars.