At what temperature will it be better to close the windows than to open them (if you want to keep your home cool in the heat)?
Whenever it's cooler outside than it is inside.  But you have to factor into the equation the humidity, breeze, impact of sunlight since you can't keep the blinds down, etc.  And if you open the windows, the humidity that enters the home takes time to be removed by the AC.

Personally, I wait until the outside high temp is about 5F above my target temp, and the lows are much lower.  Then I open the windows at night, and close the windows and blinds during the afternoon if it's getting hot out.  I also only bother opening a handful of windows, on each side of the house for the breeze, and high and low for the chimney effect.