When you make a sandwich with mayo on it the sandwich with mayo will be safe to eat for up to 2 hours before the mayo goes bad and should be thrown out.
So as long as you eat the sandwich with mayo within 2 hours it will be safe to eat.
If you keep the mayo sandwich in a cooler or ice chest then it will last longer than 2 hours before spoiling.