This phrase is often used when someone violates unspoken social rules or etiquette. He definitely overstepped the mark by joking about her divorce.
Pro Tip 2/3
Disapproval Implied
Using 'overstep the mark' implies that the speaker disapproves of the behavior. She overstepped the mark with her comments, and the audience was not pleased.
Pro Tip 3/3
Cultural Sensitivity
What counts as overstepping the mark can vary greatly between different cultures. In their culture, arriving unannounced is seriously overstepping the mark.