The law strives to help ensure that you have a safe work environment. It creates guidelines to ensure your physical safety but also to protect you against harassment that could create a mentally or emotionally unsafe place.
When it comes to sexual harassment, there are a few ways to define it and some guidelines required to ensure that there is a real harassment situation. The Equal Employment Opportunity Commission explains it is possible a joke could be sexual harassment, but it depends on a few factors.
Sexual harassment does not have to involve sexual comments. It could also include references to gender. So, the offensive joke may be about women in general, which would make it potentially harassment.
Sexual harassment can happen involving anyone. Regardless of your race or gender, the harasser could be the same or different. It could be another employee or a supervisor. So, it really does not matter who sent the joke.
The biggest factor as to whether an offensive joke is sexual harassment under employment laws is how often it occurs. If you get one joke that is not appropriate but that is the only issue you have, then it does not meet the definition of sexual harassment. Federal law requires instances to be happening often, so much so that it makes your workplace uncomfortable or hostile.
One important note is that for coverage under the law, your employer must also have 15 or more employees. If you are a small business, you cannot make a federal claim. So, keep this in mind. It does not mean the joke is not offensive or harassing, but just that you cannot make a claim.