Trying to understand capital gains tax?

So I’ll give you guys an example of something I’m trying to understand. Let’s say I’m in Virginia and I buy a stock of something at $100. A year later its value is at $150 and I decide to sell. What would I actually get back after taxes? Is it just the +$50 that gained that are taxed or do they take from the entire... show more So I’ll give you guys an example of something I’m trying to understand. Let’s say I’m in Virginia and I buy a stock of something at $100. A year later its value is at $150 and I decide to sell. What would I actually get back after taxes? Is it just the +$50 that gained that are taxed or do they take from the entire $150?
Side question is what would be different if I sold it under one year?
Thanks!
8 answers 8