The landlord may ask you to prevent waste in the form of heat going out the window. However, the landlord may not require you to keep the apartment at any certain temperature. You should insist that you be allowed to maintain the apartment at a temperature that is comfortable to you (within reason).
Please do not hesitate to contact my office if you would like to discuss this further.
You are entitled to what is known as the "quiet enjoyment" of your apartment. This means that if you want to keep the windows open to keep the temperature down, you may do so. (Hopefully you have saved the landlord's messages). There is nothing barring the landlord from observing that your windows are open. However, the landlord may not insist that you close them as long as your keeping them open does not affect the pipes. This seems like something that should be able to be worked out with your landlord. However, the situation may call for the intervention of an attorney on your behalf. Feel free to contact me if you wish to speak further concerning this matter.