Just to merge all of the IRS breakpoints together (which is the same as terran's post):
First you add up all income and short-term gains, and stack the long-term gains on top:
$0 - $80k long-term gains, 0%
$80k - $250k long term gains, 15%
$250k - $496k long term gains, 15% + 3.8% = 18.8% effectively
over $496k long term gains, 23.8% effectively
The NIIT (net investment income tax, aka "Obamacare tax") is applied in a different place than taxes on long-term gains, but when you're done filling everything out, you get the numbers mentioned above.