Any event that involves three disciplines can be called a triathlon. There could be, for example, an academic triathlon consisting of geography, history, and spelling. But a triathlon usually means an athletic event, and the three disciplines are usually swimming, cycling, and running, in that order.
The modern athletic triathlon is a relatively new sport, having been “invented” by the San Diego Track Club in the 1970s:
The Ironman triathlon consists of a 2.4-mile swim, a 112-mile cycling race, and a 26-mile marathon run. (“Ironman Triathlon” is a trademark registered by the World Triathlon Corporation, so not just any race–even at “Ironman” distances–can call itself an “Ironman.” The Ironman distances are therefore sometimes called a “long-distance” triathlon instead of an “Ironman.”)
When the triathlon became an Olympic sport, the Olympic distances were taken from existing Olympic events: the 1500m swim, 40km road cycling race, and 10km run.
Other triathlons are held at “sprint” or “international” distances:
The main “sprint” triathlons sanctioned by USA Triathlon, “the national governing body for the multi-sports of triathlon and duathlon in the United States,” consist of a 5-mile swim, a 12-to-15-mile cycling race, and a 3.1-mile run.
Just for the record, Charleston has a series of 4 sprint triathlons in the summer, and the swim is only .3 of a mile. (The biking is 12 miles and the run is the 5K.)