When you have a swimming pool the pool pump should be run during the day to keep the water flowing and prevent it from stagnating.
The pool pump filters the pool water and keeps it circulating so that algae and other stuff doesn't grow it in.
It's okay to run the pool pump at night as well if you want too but you should always run the pool pump during the day.
Also make sure to add the chlorine treatments to the pool as often as needed too so the swimming pool water doesn't go bad and need changed out.
If you keep the pool pump running during the day and do the chlorine and chemical treatments you should never have to replace the swimming pool water during the summer.