Officially - that is, if you’re a restaurant owner or something like that - the longest you’re allowed to leave it out at room temperature is about two hours (or at least it is here in the UK).
Obviously that wasn’t what you were asking, but there is no specific moment when an item of food suddenly becomes unsafe to eat. In order to become ill, you need to ingest a sufficient dose of the pathogens that cause food poisoning (or the toxins the leave in the food) - how quickly an item of food will reach this point (if at all) is dependent upon the composition and the storage conditions.
Furthermore, susceptibility varies from one person to the next - a dose sufficient to make one person seriously ill may be shrugged off by another with no more than a case of the trots.
At room temperature, I would guess that a slice of pizza consisting of bread, tomato sauce and cheese would actually dry out and spoil beyond edibility before it became significantly dangerous to eat. A similar pizza, but topped with, say, lots of meat and, mushrooms (i.e. protein and moisture) may become dangerous to eat before it becomes unpalatable.
In my college days, pizza was eaten out of the box (left out overnight!) the next day. Doesn’t even come close to the worst things were were doing to our bodies at the time!
I do this now, in my adulthood. Even pizza with mushrooms, capers, anchovies and olives. Of course, this only means about 12 hours and in the coolest time of the day (night). Never once died from it.
To be honest, a large pizza box rarely fits in our fridge either. We usually put the leftover pizza slices into a gallon ziplock and then it fits in the fridge.
Re real world danger unless the pizza is super funky in some fashion even with cooked meat on top you should be able to let sit out a sit a few days before it cultured something that would kill you. Also consider that a pizza is going to dry out substantially sitting out further reducing the favorable environment for bacteria.
Given what’s in a pizza and the cooking process I’d almost bet the pizza would become mummified before it could grow something that would generate toxins potent enough to kill you or make you sick.
I regularly eat pizza that I’ve left sitting in the box for between 1 and 5 days. I start getting suspicious of it by about the 4th day, but then I just sprinkle a little water on it and microwave it for extra long.