You report the gain or loss on your tax return. But if you have a large gain you should send in an estimated payment so you don't owe so much on your return and don't owe a penalty. Estimated payments are like the withholding you have deducted from your paychecks.
You will get a 1099B by the end of February for 2017 sales.