Typically, courts divide only marital property during a divorce. Marital property consists of all property acquired during a marriage, anything acquired with the proceeds of marital property and anything purchased with money earned during the marriage. As such, the portion of your 401(k) that you built before getting married usually will be considered separate property and not subject to division. If you didn't start with the plan until after your wedding, however, all of it could be marital.
Time of Valuation
States vary as to when, exactly, a "marriage" comes to an end for purposes of valuing marital property. In some states, marital property continues to accrue after separation, all the way up to the entry of a decree of divorce. In other states, the marital estate cuts off on the date a party files for divorce or legal separation. In still others, such as North Carolina, marital property stops accruing on date of separation, regardless of who was at fault.
You can stop voluntary contributions to your 401(k) until your divorce is finalized, but whether or not you want to do that will depend upon when your state stops the clock on the accrual of marital property. In states where value increases up until the date of divorce, you might want to halt contributions to keep from growing your spouse's share at your own expense. In states like North Carolina, there's no point; everything you earn or contribute after separation will remain your separate property. Since many employers match an employee's contributions up to a certain percentage, you could be foregoing a lot of free money by electing to stop contributions if your state's law cuts off the marital estate on date of separation.
The specifics of dividing the marital portion of your 401(k) will be governed by the unique law of your state. In community property states, courts divide marital property equally, while equitable distribution states divide it equitably, or fairly. Since "fair" and "equal" aren't always the same, equitable distribution courts can award unequal distributions in the presence of certain statutory factors. As such, if you live in an equitable distribution state, your spouse could actually recover more than half of your 401(k) -- making the decision of whether to continue contributing during the divorce process more critical.