A special rule for what is called “net unrealized appreciation” allows you to move your employer’s stock out of your 401(k) when you retire or leave your job.
You must follow the rules precisely to take advantage of lower capital gains rates, rather than ordinary income taxes, when you sell the stock.