Mayonnaise does go bad eventually even when sealed up but as long as you haven't opened the jar of mayonnaise the unopened jar of mayonnaise should easily last a year and sometimes longer.
Once you open the jar of mayonnaise however it will go bad within a few hours if not refrigerated.
After a jar of mayonnaise has been opened you should refrigerate it immediately after you're done using the mayonnaise to prevent spoilage.
If you may things such as a mayonnaise sandwich you should place it in a cooler with ice to keep it from going bad if you make mayonnaise sandwiches for lunch.
If you have any foods that you made with mayonnaise it should also be promptly refrigerated when it's not being served.
Mayonnaise beings to spoil rapidly if left out for too long.
The opened jar of mayonnaise should last for a month or two as long as you keep it sealed up after use and refrigerate it.