With ESPP plans, usually:
- You can only contribute x% of your salary (5%, 10%, 15% are common)
- You have an enrollment period when you can decide if you want in, then a contribution period (often 6 months), then at the end you get all the stock at once
- Some companies will give you the lower of the beginning or end price of the contribution period, then apply the discount, so if the price is up you win, if down you're still fine
- You usually can only sell during certain periods, but they're reasonable (eg: never near earnings reports, or product announcements, etc)
- You go through a brokerage, and they might take a few bucks per transaction
For example, I might put 10% of my salary into ESPP in six months, get a 15% discount on the lower of the beginning or end price, then have the stock appear in a brokerage account at the end of six months, which I might immediately sell or sell as soon as possible (or hold on to, if I want to be risky); and it might cost me $10 to sell it all. $10 would be, in this example, about 0.2%.
Taxes:
- Upon purchasing, you're taxed on the discount
- Upon selling, you're taxed on the profit (sold price vs market price when bought - you already got taxed on market price vs buy price)
- If you hold it for a year, you pay long-term capital gains on the profit; otherwise short-term (US).
It only profits you to hold it to get the long-term rate if you think the company will do at least almost as well as your favorite index. (Almost as well as, meaning it doesn't have to beat it, because you win on paying less tax and you win on not paying an expense ratio.)
This horse has been beaten to death and back to life on this forum.