I set up the 401k plan at my company and am one of the administrators.
Every plan is different. Each plan has a set limits for certain things.
If you have under a certain amount vested in the plan, you could be automatically cashed out as soon as your employer notifies the fund that you have terminated employment.
If you have under a certain amount (not necessarily the same as the above paragraph), you will not be allowed to keep your money in the group 401k plan. If you are over that set amount, your employer cannot make you withdraw your money from it. Our plan has this set at $5000 and there are several employees who terminated years ago who still have their money in this fund. The employer would probably prefer you move it because they pay fees for each individual in the plan, but they can't make you take it out unless you are below their set limit.
Once the plan is notified of your termination from the plan, you will receive forms, most likely from a company acting as third party administrator that you will have to complete if you want the money transferred. If you have any questions about the rules of your particular plan, call that third party administrator. They will be able to tell you if you have to take your money out now or whether you can leave it there until you are ready to transfer it to another retirement account (or cash it out and pay the taxes/penalties for early withdrawal).