If not consumed within 48 hours, you should refrigerate your pineapple upside-down cake.  If your kitchen is hotter than 70oF you should refrigerate it immediately.