Capital gain is the surplus realized when an asset is sold at a higher price than was originally paid for it. Because of inflation, however, it is important to distinguish between nominal values and real values. Thus what appears to be a large nominal gain may, after allowing for the effects of inflation, turn out to be a very small real gain. Furthermore, in an ongoing business, provision has to be made for the replacement cost of assets, which can be much higher than the historic cost of the assets being sold.
When you sell an asset at a higher price than you paid for it, the difference is your capital gain. For example, if you buy 100 pieces of stock for $40 a piece and sell them for $60 a piece, you realize a capital gain of $20 a piece, or $2,000 in total.
If you own the stock for more than a year before selling it, you have a long-term capital gain. If you hold the stock for less than a year, you have a short-term capital gain.
A capital loss is incurred when, on the contrary, there is a decrease in the capital asset value compared to an asset's purchase price.