If you can avoid weekends, probably any time now. I nearly always see "space available" signs at the kiosk even when it was originally sold out, and there are always empty campsites, especially if the weather turns cold, rainy, etc. Not so much if the weather's great, but still possible.
No guarantees, of course, and I always make reservations ahead of time, but this time of year there are lots of cancellations, and at worst you might have to move your site if you're staying a while. There are spaces available now toward the end of October, off-weekend for several nights.
Gary
Yosemite Photo Galleries: http://www.pbase.com/roberthouse/yo