http://www.med.navy.mil/Accessions/Pages/Pay.aspx
Relevant part:
X. Thrift Savings Program (TSP): The TSP is a retirement savings plan for civilians employed by the United States Government and members of the uniformed services. Only active duty pay and bonuses are eligible for the TSP. HPSP/FAP stipend is not eligible for deposit into a TSP account. The Federal Retirement Thrift Investment Board administers the Thrift Savings Plan (TSP). The Web site
http://www.tsp.gov has extensive information about this program. All military active duty are eligible to participate in the TSP, which allows active duty members to contribute up to a yearly specific limit of "pre-tax" dollars into the managed funds. HPSP and FAP participants can only open a TSP account when on Annual Training.
To establish an account, during an Annual Training period, go to the nearest personnel support detachment (PSD) and have them initiate a TSP account for you. If the PSD cannot input this, please email the signed TSP-U-1 form to [email protected]. Include a cover sheet with a short explanation. DFAS will enter the data.
So it seems you could open an account only when you are on ADT. Note the stipend is not eligible for this.
My interpretation is that only active duty income/bonuses are eligible for contributions, meaning you couldn't contribute $5000 of savings (non-payroll) to the TSP just like that. As an O-1 during school, if you could even choose to contribute 100% of active duty pay/bonuses, that would at most amount to ~6000-9000 (O-1 pay + variable BAH + BAS for 1.5 months)