A capital gain is "the profit that comes when an investment is sold for more than the price the investor paid for it" (Investor.gov). Buy shares for $1,000, sell them later for $1,300, and the capital gain is $300. Sell for less than you paid, and it's a capital loss.
The IRS uses the idea broadly: "Almost everything you own and use for personal or investment purposes is a capital asset," including a home and "stocks or bonds held as investments" (IRS).
How long you owned something matters for taxes. "Generally, if you hold the asset for more than one year before you dispose of it, your capital gain or loss is long-term." One year or less is short-term. The two are taxed differently.