Mayonnaise will last between 2 to 3 months when you keep the opened jar of mayonnaise closed and in the refrigerator.
If the mayonnaise hasn't been opened then the jar of mayonnaise should last up to 6 months before going bad.
When the mayonnaise goes bad it will usually have a rotten egg odor or an acidic, or putrid smell to it.
Bad mayonnaise will also likely have some mold growth, mold spores etc as well as an off taste and a change of color, like darker shade of white or brownish yellow.
If the mayonnaise smells bad or tastes bad then you should throw it out because it could give you a stomach ache or possible food poisoning.
Although food poisoning is not very serious in most cases it can be deadly so if in doubt just throw the old mayonnaise out.