The short answer is “as soon as possible”. The longer the moisture has a chance to stay in the window, the more likely there will be staining on the glass or possibly rust on the spacer. Even when treated late in the fall, a window will still continue to expel moisture from between the panes during the cold months, although at a slower rate than when done in the spring and summer when the days are longer and there is more heat.