With a sufficient sized panel, it can store enough heat to sustain your swimming pool even though at night the solar panel can’t generate power anymore. This is assuming that your solar panels are sized correctly for your pool. Ideally, the surface area of your solar panels should match the size of your pool. It is possible to have less/smaller panels but the heating process will be slower.