That is a hard question.
Hardly anything is funny unless someone is shamed or pained.
But the falloff happens suddenly when the shame or pain is too great.
I recently watched a video of Sammy Davis Junior performing with Dean Martin and Frank Sinatra, the songs were good and the audience was rolling over the jokes. But the jokes were too racially insensitive for someone conditioned as I have been , so I got a lot more cringe than humor. This was top of the line at the time , but the markers have moved since then.
I like to be funny , but I hate to suffer shame , so there are a lot of jokes I don't repeat, either they are not funny enough, or they are over the marker for offense.
Realizing the placement of this marker is the hardest part , and watching Chappelle is not, much help.
https://www.reddit.com/r/videos/comments/5colix/dave_chapelles_snl_monologue/https://www.youtube.com/watch?v=zHKprqCNUmcI could not find the same one again , but this one is similar, at about 1:20 Johnny Carson asks Sammy Davis Jr to do an impression of a race riot. They are all very familiar with each other and having a good time, but there are several things that would not fly right now.
Perhaps what makes the difference is how such things get understood, where the intent is clearly humor you can get away with a lot, when the intent is clearly to hurt you can't even smile.