Before knowing how long you can store the cake, you must know how to store the cake. The unfrosted cake in the fridge will last for 3-4 days if stored properly. This means, as soon as the cake cools completely, and you don't intend to frost them immediately, then it is better if you cling-wrap it completely and refrigerate it in a bag. If the cake is left open for too long especially when you leave it to cool, it will lose moisture and become too dry. You may fix this by drizzling some sugar syrup just before frosting. The cake with cream cheese frosting can be refrigerated for 1-2 days at most. You may freeze the frosted cake for up to 3 months but ensure it is wrapped properly and stored in airtight boxes or bags.