The gerund phrase is the object of the peposition for, not a subject.
A gerund can be either timeless (it can refer to any time in past, present, or future) or refer to a specific time frame. In your example, the timeless gerund leaving the window open works well enough; in who is responsible for leaving the window open, it refers to leaving the window open in general, without referring to a specific time per se.
It is the context, however, that supplies the temporal information: because you are pointing at a window that is now open and was therefore left open in the past by someone, it is clear that you are talking about a "leaving open" that happened in the past. This information is not (and need not be) included in the gerundial phrase itself.
Suppose you, as a teacher, heard a phone ring incessantly in class. You could ask this, while it was still ringing:
Who is responsible for making this noise?
It would refer to the present, but that can only be known because of the context, not because of the gerund itself.
The same applies to infinitives:
I hope to see you soon.
Context points to the future.
I like to kiss horses.
Context suggests to a habit that happens in past, present, and future.
He ceases to impress me.
Context makes it refer to the past.
In some situations, it is desirable or even necessary to explicitly show that the action described by a gerund or infinitive took place in the past; in that case, having done or to have done is used.
Her losing her mind is a terrible thing to observe.
Her having lost her mind is a terrible thing to observe.
Without having, the natural interpretation of the gerundial phrase is for it to be simultaneous: someone is observing the process of her losing her mind as it is going on. This is not necessarily the only interpretation; but, when context allows it, the default is an interpretation simultaneous with the main verb (is a terrible thing to observe). If you add having, you force a perfect interpretation, where the action happened in the past before the main verb; it is already finished and you are observing the result.
In a different context, the same timeless gerund can refer to the past without the need for having:
Her losing her mind is the most terrible thing that happened this year.
The losing has clearly ended, it happened in the past and is no longer going on, and yet no having is needed. You could say her having lost her mind here, just as in your example about the window, but it is not necessary.