Check the pump specs. What's the current rating?
1.5hp is about 1,125W, but that's it's output. It's likely going to use as much as 50% more than that, so let's say 1700W. Additionally, power system inefficiencies are probably going to increase that to 2000W when looking out how much energy you'll need to collect from the sun.
2 hours: 2h * 2000W = 4,000Wh
6 hours: 6h * 2000W = 12,000Wh
Those are your energy targets.
Pump motors tend to have very high surge, typically 5X the run current. That means, your inverter will need to be able to supply a peak of 8500W that tapers over a few seconds.
Assuming you get great sun, with 5 hours of insolation (that means you'll get the equivalent of 5 hours of maximum panel output over the course of the entire solar day from , you'd need:
4000Wh/5h = 800W of solar panels will accumulate enough energy to power it for two hours, but you'll need 4000Wh of batteries too.
12000/5h = 2400W of solar panels.
Would probably make more sense to get 3000W of solar and only power the pump when the panels can drive it.
Figure about $2500-4000.
How much is a high quality extension cord?