So, back to the matter at hand - how long can you safely leave macaroni and cheese out? The general rule of thumb is to not leave it out for more than two hours, and that's in a cool room, not a warm one. After that, the risk of foodborne illness starts to increase.
Now, you might be thinking, "But I've left it out for longer and I'm fine!" And, yeah, maybe you have been lucky so far, but don't push your luck! Food safety is no joke, and it's better to be safe than sorry.
And, let's not forget about the temperature - if it's a hot day, or you're leaving it out in a warm room, you should reduce that time to one hour, max! You don't want your macaroni and cheese to become a breeding ground for bacteria.