> cost several thousand dollars
In that area. Perhaps more with batteries and the DC-AC conversion.
> window unit draws about 5 amps.
600 Watts? Sounds puny.
I'll assume 8 Amps at 120V, 1KW, for easy math.
1KW for one hour is 1KWH.
I pay at most $0.16/KWH for utility-company power.
8 hours a night, 100 nights per year, is $128 per year. (And an appropriately sized A/C should not run ALL night EVERY night, it should cycle on the thermostat.) $1,280 over ten years. And pay-as-I-go (weeks after I burn the power).
The solar system will be, as you say, "several thousand dollars".
Say that "several" is "3". $3,000.
That will have to be paid Right Now (this month on a credit-card).
It is not fiscally smart to pay up-front for a break-even many years down the road. Compare it against putting your money in the bank at interest. Even at today's pathetic rates you could probably place $3K long-term and get $100/year of interest. That almost covers the electric bill, and at the end you still have $3K.
If the solar array was a really LONG term investment, you might figure it different. I've gotten into 30-year mortgages to get a roof over my head. Houses usually last longer than 30 years (my last had survived 177 years) and usually have some resale value (mine doubled in sale-value in 19 years). The super-good solar cells used in spacecraft may last that long (though I think they do fade over decades). Consumer grade are not so defect-free, not so well sealed. By 5 or 10 or 15 years out you are replacing individual cells (messing with the panel seals and fragile solder joints). By 2025 (maybe sooner) you will be seeing better panels at lower prices, and toss the old ones. Very bad fiscal pay-back.
Since you want the A/C in evening and night, when the sun don't shine, you will need a battery. A car battery is rated 50 Amp Hours at 12V. At 120V that is 1 hour running your 5A A/C. So you need 8 or 10. Plus DC/AC conversion, say 11 or 12. But car batteries are not built to be drained flat every night. There are Deep Discharge batts made for the purpose. They are about twice the weight and cost per AH as car batts. So figure two dozen car batts, that's at least $2,000 just for batts. And for-sure they will be losing capacity in 5 or 10 years, need complete replacement.
So... "several" thousand dollars (perhaps $5K total), to save $128/year. That's a 39 year payback. And zero end-value (you'll probably pay to have the dead panels and tons of dead batts taken away).
There's also the fun of working on roofs, snow, dust/dirt/pollen! or giving-up garden/lawn space for solar arrays.
(I grant that snow may not matter in an A/C only application; tho we had snow upstate just a week before we had a steamy day on the coast.)
All this assumes you HAVE utility power. If you are back in the woods, it may be $20K on up to bring a power line to your house. If you want to light a shed it may be $500-$2K to get a proper/legal electric line run out to the shack. In such cases it may make good economic sense to run solar.
OTOH, I always am amazed at the school-zone flashing lights which have a solar panel, yet are right UNDER a power-line. Yes, the daily demand is super low (100 Watts 20 minutes a day?) and getting a power-drop may be more costly than a solar panel and a battery. (Around here the lights may be under a 13,000V line but the nearest 120V power is hundreds of feet away, and cable mechanically appropriate for overhead runs is electrically way over-kill for small loads.)
But maybe you just want to Save The Planet?
Are you? Burning coal (oil, gas) to make utility power is dirty, true. But making large-area semiconductors is dirty in other ways. One reason semi production moved out of the US is the pollution it causes. It has moved around the world, and gotten a bit better, but still un-clean. It may be mostly "local" pollution: pools of toxic waste behind a factory in China instead of smog in your area. I'd want to know more about this trade-off before getting too virtuous about it.
And the lead batteries, though lead-batts tend to be 98% recycled. The batt-factory takes back the trade-ins, chop and melt, neutralize the acid and sludge, and build new batts. (LiOn etc offer more energy density, but still less KWH/$, and the recycling process is not so well developed.)