The useful way to think about an unrealized gain is as an unsettled question with four possible answers, because the tax result differs in all four and the choice among them is usually available.
You sell. The gain is realized, becomes a capital gain, and is taxed for that year. This is the only one of the four endings that produces a tax bill, and it is also the only one most people picture.
You hold it until death. Under IRC 1014 the basis of inherited property is generally reset to its fair market value at the date of death, so the gain that accumulated over the owner's lifetime is never taxed as a capital gain to anyone. The heir who sells promptly afterward has little or no gain to report. The details, including which assets receive this treatment and which do not, belong to the page on the step-up in basis.
You give it away during your lifetime. The gain does not disappear and it is not taxed to you. Property received as a gift generally carries the donor's basis across to the recipient, so the unrealized gain travels with the asset and surfaces when the recipient sells. Giving an appreciated holding to someone is therefore also giving them the tax on it, which is a fact worth knowing in advance rather than after.
You donate it to a qualified charity. A charity that sells the asset pays no tax on the gain, and a donor who gives the appreciated property itself rather than the cash proceeds generally never realizes the gain at all. The conditions on that treatment, including the type of property and the deduction limits, are set out on the page for donating appreciated stock.
What an unrealized gain actually does to most people is change a decision, not a tax return. A large unrealized gain makes selling expensive, and that expense attaches to a position rather than to a judgment about it. The result is a familiar pattern: a holding that has done extremely well becomes a larger and larger share of a portfolio, and the tax that would be due on selling is the reason given for leaving it there.
The question that separates the two considerations is whether you would buy the position today, at today's price, with cash. If the answer is yes, the unrealized gain is irrelevant to the decision. If the answer is no, then the tax is the cost of correcting the allocation rather than a reason to leave it uncorrected, and its size can be compared against the risk being carried. That comparison is a real one and can come out either way; what it should not do is go unasked. Partial sales, using new contributions to build other positions, and giving or donating the appreciated shares rather than selling them are the usual ways the question gets answered somewhere between the two extremes.
One further point of arithmetic, because it changes how a statement reads. An account balance is an unrealized figure. Part of the number, for a taxable account holding appreciated assets, represents tax that has not been paid yet, and spending the money requires realizing enough gain to pay it. Two people with identical balances and different bases do not have identical amounts of money.