It can generally stay good for about 2-4 days at room temperature if it's covered, but it’s best to refrigerate it if you want to keep it for up to a week. Just cover it with plastic wrap or place it in an airtight container.To tell if it’s gone bad, check for any off smells, changes in texture, or mold. If the pie starts to smell sour or unusual, or if the filling looks or feels different, it’s better to be safe and throw it out. Also, if it’s been sitting out at room temperature for more than a couple of days, it’s best to discard it to avoid any food safety risks. Enjoy your pie and stay safe !