This sentence describes a future action based on a current condition. 'I will close the window' is used for a spontaneous decision made at the moment of speaking because of the cold. 'I am going to close the window' implies a pre-planned action, though in this context, it can also be used to express a decision made now. Both are grammatically acceptable here, but 'will' often emphasizes the immediate reaction.