Taxation of ESPPs can be a bit complicated for shares bought at a discount.
Just like with any other stock, the difference between your cost basis and your sale price is a capital gain or loss (short-term for shares you owned less than a year, long-term otherwise). If you're in the 25-35% tax bracket, you'll pay 15% of the long-term capital gains in tax. If you're in the 10-15% bracket, you pay 0% on the long-term gains.
What makes it complicated is that your cost basis is
not the same as the amount you paid for the shares. There's a two-year holding period from the "option grant date." If you meet the holding period, the cost basis is generally equal to the market price of the shares on the option grant date. If you sell before the end of the holding period, the cost basis is generally equal to the market price of the shares on the purchase date. In either case, the difference between your cost basis and the amount you paid counts as
compensation income in the year you
sell the shares.
What's worse is that the IRS requires brokers to report the purchase price as the cost basis on 1099 forms, which is probably wrong! Your employer is required to report the compensation piece on a Form W-2. If you simply transfer the numbers on both forms to your tax return, you'll end up paying tax on the compensation piece twice: once at your regular income tax rate, once at capital gains rate. What you're supposed to do is file an adjustment to your basis for these shares when you fill out your Schedule D so that you don't get double taxed. I'm sure lots of people neglect to do this. See
http://forum.mrmoneymustache.com/investor-alley/your-2014-1099-b-form-for-an-espp-sale-will-probably-be-wrong/ for more discussion on this issue.
You're right that you would likely owe less tax if you wait to sell these shares after you retire. The difference would depend on your current and expected future tax brackets. Be sure not to let the tail wag the dog here. You're taking a pretty significant risk by having this much of your net worth in one single stock. Balance this risk against the potential tax reward from holding on to the shares. I would sell all the shares over the next year or two if I were in your shoes.