In your investment account, you might see “Unrealized Gain/Loss”. That just means how much your investment has appreciated since you bought it. Unrealized just means you haven’t locked in that gain or loss by selling the investment. Once you sell it, the gain or loss becomes a “Realized” gain or loss.
You have to pay taxes on your realized gain at the end of the year. There will be a form from your investment account that you file with your taxes. “Short-term gains” are for assets held less than one year. “Long-term gains” are anything held longer than a year. Taxes on short-term gains are much higher. So it’s always better to invest for the long-term if you can.
You don’t pay any capital gains taxes on retirement investment accounts like 401(k)’s and IRA’s. You can buy and sell things in those accounts as much as you want without extra taxes. That’s why they are great long-term investment options. The money compounds way faster, and you don’t have to give up a big portion to the tax man.