There are 18 holes in golf because the owners of St. Andrew's course elected to standardize this number, and as a leading club group in the game, many courses followed.
The sport of golf used to have no standards in regards to how many holes per round were played. Some courses had 15 holes, some had 7 holes, and even the first course to have 18, The Old Course at St. Andrew's in Scotland, originally had 12 holes. However, many were played it twice, making it a round of 22 holes played. Confusing right?
The Old Course at St. Andrew's is regarded as the "home of golf" because the sport was first played there in the 1400s.
In 1764, the owners of the golf course, a club named The Royal and Ancient Golf Club, decided that the 22-hole course should be shortened to 18 holes "for the improvement of the links." Links is another term for a golf course.
The Royal and Ancient Golf Club (R&A; for short) is still active, and is the oldest golf club in the world. They became prominent leaders of the sport, which led to many other golf courses following suit in making the 18-hole course. However, the number of unique holes the course had was still 12. So when did St. Andrew's, and then by default all other professional golf courses, construct 18 unique holes?
Around 1856, the R&A; renovated the golf course, changing the putting greens and adding holes, with some having 2 flags on a single green. The color of the flag designated which hole the golfer should aim for, and thus a unique, 18-hole course was born.
The course has multiple holes that share a green. Some examples are 8 and 10, 7 and 11, along with 6 and 12.
As previously stated, the Royal and Ancient Golf Club had tremendous influence over the rest of golf, so once they decided to have 18 holes and construct them, many other golf courses followed simply because of their influence.