Realization and recognition

Im a little unclear as to the difference between Realization and recognition of a gain for tax purposes. Can someone please explain me their definition, and the difference for GAAP purposes versus tax.