How long can homemade cake sit out?
Are you worried about it drying out/going stale? Or are you worried about ingredients like buttercream icing ?
If it's been iced and decorated, the rule of thumb is 4 hours. If it's been cut and served, and I certainly hope it has, you only need to peel off a piece of plastic wrap and fold it to fit snugly up against the cut sides before refrigerating it. The cake itself has been enclosed in icing, which protects it from drying out.
In most states, it is illegal to sell to the public any food product which has been prepared in a kitchen that has not been inspected and its operator licensed.
You need to contact your local health department and find out what their laws are. I would be very surprised if the store which has given you this opportunity did not inform you of that.
If you are both unlicensed and working from a kitchen that has not been inspected, the store's liability insurance likely will not cover you if something goes wrong. And if you are concerned about cakes sitting at room temp for potentially too long, something could very likely go wrong. Not a risk I'd be willing to take.
Way to go, boulangere!