A cake with cream cheese frosting can sit out at room temperature for about 2 hours. After that, it’s best to refrigerate it to prevent the frosting from spoiling. If you’re serving the cake at an event, keep it chilled and only bring it out right before serving.