There is no definitive optimal time frame for searching for student housing in Washington D.C.. But, if you start looking for a home earlier, you'll have a better chance of finding one you love at a great price.
Most students start looking for student housing in D.C. in January. If you see a suitable one during this period, you can apply as soon as possible; otherwise, you can wait. But if it's May or June, rent as soon as possible. The longer you delay, the fewer options available. After August, even fewer options for student accommodation in Washington D.C. will be available.