No intentional teamwounding/teamkilling during a round (teamkilling friends after a round ends is allowed, teamkilling random people is not).
Source
That means after a round is totally, completely over.
As in, everyone on one team is dead or a flag was raised completely and the round has actually ended.
Those few three or four seconds before the round resets are when it's OK by the rules.
That said, it's so very rarely enforced (TK'ing/TW'ing almost before the round's end) that it's not just to enact any punishment on it.
There's no expectation for it.
The only time it's considered is when it's continuous over multiple rounds, people are getting annoyed with it, and people have already complained and have asked the person to stop beforehand.
That doesn't mean they aren't breaking the rules, but it's a cunty thing to try to get someone banned over.