Would it be more environmentally friendly to keep the air conditioning on the programmable thermostat at all times or to open the windows and then turn on the AC if it gets too hot?

You answered your own question correctly, use the progamammable thermostat, you will have less humidity to contend with and the unit will work less. the area you are trying too keep cool will be cool, the only time the unit will come on is when the temp goes above the set point that you have put in to maintain a cool temp.