In America, for a non-professional trader, this is not a complicated issue.
Ignore @Overnight, he's only good for posting music videos.
You can deduct losses up to your gains + 3,000. The rest is carried forward to the next year and is applied as loss for that year for the same calculation...