There are a few tips that you can follow to keep your cake fresh for a longer duration:
Always store the cake when it is completely cool. Cakes with frosting and icing should always be refrigerated.
Always store the cake in a large bowl so that there is breathing space.
Unfrosted cake can be kept at room temperature.
Cover the cake while storing it.