Pumpkin Pies can sit out at room temperature for up to 2 hours.
After 2 hours of sitting out the pumpkin pie will grow bacteria that you cannot see and it should really be thrown out to avoid risk of getting sick from it.
If you don't plan to eat your pumpkin pie within 2 hours make sure you refrigerate it and do not leave pumpkin pie out overnight because it too can grow bacteria on it.
The pumpkin pie will last for around 3 to 5 days in the refrigerator and if you want to keep the pumpkin pie longer than a few days you should freeze it.
When frozen the pumpkin pie will last for 6 months to a year but for best quality and taste eat the pumpkin pie within a few months.