I don't think it has any hard fast rules. CJO is good for one year, so potentially that far out. Realistically they'd prolly put more priority on a guy 6-3 months out, knowing you are a more sure bet not to stray in that timeframe.
If you have terminal leave saved up, you could start class while on that and keep the pay and benefits.
Since the process from interview to class can take some time, I'd say interview NLT than 2 months out from separation.