A pumpkin pie should be refrigerated, unless it is going to be served no more than two hours after being pulled from the oven. It needs to be refrigerated after that point because bacteria are able to grow and can make those who eat the pie sick.
Eating unrefrigerated pie can cause illness because bacteria grows on egg-based food that is not kept chilled. At temperatures between 40 and 140 degrees Fahrenheit, bacteria multiplies quickly and can cause food-borne illnesses. However, store-bought pumpkin pies contain preservatives and defy this basic rule, so they do not need to be kept refrigerated.