I am marginally in a lower tax bracket based on W2 income. If I add capital gains from stock sales, then this tax bracket would go higher. Does capital gains actually affect your tax bracket or are they just taxed separately (based on long-term vs short-term gains/losses) ?
I think you're misunderstanding how tax brackets work. If you make $1 more and that bumps you into a higher bracket, only THAT particular dollar will be taxed at the higher tax bracket rate... Not your entire income.
Short term capital gains are treated as income. Long term capital gains have a special tax rate currently.
I'm not sure where you are, but in the United States capital gains are taxed at a lower rate than other types of income.
On the 1040, captial gains income is separated from earned income, and income tax is calculated just on earned income. Then capital gains tax is calculated on capital gains income, and then added to income tax afterward.