Run your pool pump 8 hours a day in July.
8 hours is plenty.
You really only need to turn over your pool’s water once a day. For most residential pools, that takes about 8 hours with a standard single-speed pump running at full speed. In July, the heat and sun demand more, but 8 hours still gets the job done.
If you have a variable-speed pump, you can run it longer on low speed (say 12-16 hours) and save electricity. The slower flow is gentler on your filter anyway.
Running it less than 6 hours risks algae. Running it more than 12 is usually just wasting money unless your pool is heavily used or has a lot of leaves.
Don’t run it overnight unless you need to avoid peak electric rates. Your pool doesn’t care what time it circulates.