The statute actually separates two ideas that are easy to treat as one: realization and recognition. IRC 1001(a) computes the gain realized on a sale or disposition. IRC 1001(c) then addresses a different question, stating that "except as otherwise provided in this subtitle, the entire amount of the gain or loss, determined under this section... shall be recognized." Recognition is what makes a realized gain currently taxable; realization is what quantifies it in the first place. On an ordinary sale of stock through a brokerage account, the two happen in the same instant, which is why most explanations of the subject treat them as one event. They are not always the same event, and the gap between them is where some of the more useful planning provisions in the Code live.
A handful of provisions realize a gain without recognizing it, and that gap is deliberate rather than a loophole. The clause "except as otherwise provided in this subtitle" in IRC 1001(c) points to those provisions. A like-kind exchange of qualifying real property under IRC 1031, for example, can realize a gain on the disposition of the old property while deferring recognition of that gain, generally by carrying the old property's basis over into the replacement property, so the tax is postponed rather than eliminated. The mechanics of any specific nonrecognition provision are a subject of their own; the point worth taking from IRC 1001's structure is that "realized" and "taxed right now" are not strictly synonyms, even though on the overwhelming majority of everyday sales they arrive together.
Once a gain is realized, its character is fixed by the holding period that already ran before the sale, not by anything that happens afterward. A capital asset held for more than one year at the time of the sale produces a long-term realized gain; one year or less produces a short-term one. That classification, and the definitions governing it in IRC 1222, are covered in full on the page for capital gains, since the realization event this page describes is the trigger for those definitions rather than the source of the holding-period rule itself.
A realized gain is reported for the year the sale or exchange actually occurs, not the year the asset was bought or the year the price first rose above cost. An asset can trade above its purchase price for several tax years running before the owner ever sells, and none of those intervening years produces a reportable event; only the year of the sale does. This is also the mechanism behind timing decisions such as choosing which tax year to realize a gain in, or realizing a loss on a separate position in the same year to offset it, both of which depend on the fact that realization, not mere price movement, is what starts the tax clock.
The rate and additional-tax questions that follow realization belong elsewhere. Whether the realized gain is taxed at ordinary or preferential rates, whether it is subject to the net investment income tax, and how a step-up in basis at death can eliminate a gain that was never realized during the owner's lifetime are all questions about what happens after a gain has been realized, and each is covered on its own page.