If I retire or leave federal service for another reason, do I have to withdraw my TSP account?
No. You can leave it in place and continue to manage the money by moving it among the investment funds if you wish. However, you cannot make new investments nor can you borrow against it.

The main restriction is that you are required to withdraw your account balance in a single payment, begin receiving monthly payments, or begin receiving annuity payments by April 1 of the year following the year you become age 70 1⁄2 (or the year following the year you separate from federal service, if you work past age 70 1⁄2).