Shared laughter should leave everyone included
A joke can create closeness, but the person it targets may experience it differently from the people laughing. If someone asks you to stop teasing about a subject, that information matters more than your intention to be funny. Warmth depends partly on how the humour is received.
Go deeper
Notice who is enjoying the joke
A group repeatedly jokes about one person's old mistake. The story is familiar and gets a laugh, but the person involved has started asking for another subject.
Shared humour requires attention to the people sharing it. A joke that once felt comfortable can stop feeling that way, and a laugh does not always make someone's preference clear.
When a limit is expressed, continuing to explain that it was only a joke misses the new information. The person has identified a subject they no longer want used for entertainment.
Changing direction does not require ending all playfulness. It can mean finding humour in a shared situation instead of returning to a detail that leaves one person carrying the cost of the group's amusement.