59 1/2. For Traditional 401(k), you owe the taxes on it and an additional penalty if you withdraw early. You're required to take distributions from it starting at 70 (69 1/2?), because the feds want their tax dollars.
Roth 401(k) plans are less common, you'd owe a penalty but not taxes since it's pre-tax money. No mandatory distributions because they've already gotten your money.
IRAs are the same. HSAs (mentioned elsewhere) are tax-free if distributions are spent on medical costs. For non-medical costs, you owe taxes and a penalty. After age 65 you'd only owe taxes.