Do I need a comma after "when" in this example?

No.

A comma is typically used to separate sub-clauses or items in a list. It is definitely not used after the word "when" in a situation like this.