Which Artikel you use depends on the genus of the corresponding word.
Das Jahr (neutral)
Der Monat (masculin)
Die Woche (feminin)
But "nächsten Fenster" can also be correct. You need to set it in a context of a sentence. Just the two words are not correct; that would indeed be "Das nächste Fenster".
But if you build the following sentence the usage of "nächsten" is correct:
Es hängt am nächsten Fenster.
Here you got the combination of the genus and the casus of the object (Fenster in this sentence). Fenster is the dative obejct. You can be sure about that by simply asking "An wem oder was hängt es?" - "Am/An dem Fenster".