It's hard to imagine a dessert more decadently rich than cheesecake. In fact a good cheesecake is such an intense experience, you might need several days to finish one. That's a potential problem, since the rich mixture of high-protein cheese and eggs is just as appealing to potentially dangerous bacteria. The exact refrigerator life of your cheesecake isn't an easy thing to calculate, but a bit of common sense can help you avoid nasty surprises.
The U.S. Department of Agriculture's Food Marketing Institute, which deals with commercial food products, suggests a refrigerator life of up to seven days for retail cheesecakes unless their packaging specifies a shorter date. For homemade baked goods containing eggs, which includes cheesecakes, the official standard is three to four days. If you know you won't eat the whole thing in that time, it's best to cut the cheesecake into smaller portions and freeze the extra for later.
The catch, of course, is that these guidelines assume your cheesecake has been properly refrigerated all along. If it gets too warm on your way home from the store, or the cheesecake sits out for too long after it's baked, the dessert can spoil with unsettling speed. Use the same rule that applies to any potentially hazardous food, and discard a cheesecake that's been at room temperature for more than two hours. Spoilage bacteria can give your cheesecake an "off" smell, yellowed color and unpleasant flavor, but salmonella and other potentially dangerous bacteria won't betray their presence until it's too late.