This article's factual accuracy may be compromised due to out-of-date information. In particular: the rules have been completely rewritten for 2019. (January 2019)
The rules of golf consist of a standard set of regulations and procedures by which the sport of golf should be played and prescribe penalties for rule infractions. They are jointly written and administered by the R&A (spun off from The Royal and Ancient Golf Club of St Andrews) the governing body of golf worldwide except in the United States and Mexico, which are the responsibility of the United States Golf Association (USGA). The rule book, entitled Rules of Golf, is published on a regular basis and also includes rules governing amateur status.
A central principle, although not one of the numbered rules, is found in the R&A rule book's inside front cover: "Play the ball as it lies, play the course as you find it, and if you cannot do either, do what is fair. But to do what is fair, you need to know the Rules of Golf."
In addition to the rules, golf adheres to a code of conduct known as etiquette, which generally means playing the game with due respect for the golf course and other players. Etiquette is often seen as being as important to the sport as the rules themselves.
Before the rules of golf were standardised golf clubs commonly had their own set of rules, which while broadly the same had subtle differences, such as allowing for the removal of loose impediments, e.g. leaves and small stones. In the late 19th century, most clubs began to align themselves with either the Society of St. Andrews Golfers, later the R&A, or the Gentlemen Golfers of Leith, later the Honourable Company of Edinburgh Golfers.
The earliest surviving written rules of golf were produced by the Gentlemen Golfers of Leith on March 7, 1744, for a tournament played on April 2. They were entitled "Articles and Laws in Playing at Golf" and consisted of 13 rules. The original manuscript of the rules is in the collection of the National Library of Scotland 
Debate surrounds the authorship of these regulations, which were signed by John Rattray and which--on matters of order of play, outside interference, water hazards, holing out, making a stroke, and the stroke and distance penalty for the loss of a ball--remain an integral part of the modern game. Rattray's sole signature does not guarantee that he was wholly responsible for them, though his prominence within the company and Edinburgh society at large makes him the most likely candidate. Under these rules he went on to win the silver club for a second time in April 1745.
The Rules of Golf and the Rules of Amateur Status is published every four years by the governing bodies of golf (R&A/USGA) to define how the game is to be played. The Rules have been published jointly in this manner since 1952, although the code was not completely uniform until 2000 (with mostly minor revisions to Appendix I). Before 2012 the USGA and R&A presented the same content differently in separate editions. The same content is now published in a uniform fashion with similar formatting and covers -- the only differences are now some spelling and their logos. The Rules Committee of The R&A, which was spun off from The Royal and Ancient Golf Club of St Andrews in 2004, has responsibility for upkeep and application of the rules worldwide except in the United States and Mexico, which are the responsibility of the United States Golf Association (USGA).
The term "Rules" can be said to include the following:
The Royal and Ancient Golf Club of St Andrews is a private golf club run for the benefit of its members. As such, since 2004 it has passed responsibility of publishing the rules to a private company, R&A Rules Ltd, operating under the stewardship of the golf club.
The Rules of Golf book includes a section on proper etiquette, defining recommendations that make the game safe, enjoyable and fair for all players. While none of these guidelines are enforced by penalty in and of themselves, the course authorities or other local "committee" may, under Rule 33-7, disqualify any player who acts in serious breach of etiquette, thereby violating the "spirit of the game". Such serious breaches include actions made with intent to damage the course, facilities or other players' equipment, to injure other players or disturb/distract them while making their play, to unreasonably hold up or delay other players from continuing their game, or to use any of the Rules or Decisions for the purpose of gaining an unfair advantage over any other player.
The rulebook also include definitions of terms used throughout the rule-book (sometimes including examples of what does or does not meet a definition), and defines the use of particular words in context to clarify what is meant by the use of a word. The rules, for instance, differentiate between use of "a" and "the" referring to objects involved in play ("a ball" refers to any ball that can be used in a situation; "the ball" specifically refers to the ball previously mentioned in the Rule), or between "may" (discretionary), "should" (non-binding recommendation) and "must" (binding requirement). Where used in the Rules, the definitions of the terms are binding and must be strictly observed; players must not use a differing definition in order to include or exclude an object involved in play from a particular Rule governing the object.
In addition to the Rules and Etiquette, a number of interpretations of the Rules have been published by the USGA/R&A that prescribe the proper procedure in certain situations where the Rules themselves may not be clear. The Decisions are numbered based on the Rule or sub-rule being interpreted and the order in which Decisions were published. When a player has a question, they may ask a rules official who has an actual "Decisions Book".
Decisions may be simple clarifications. For instance, a note in Rule 17-1 says anyone "standing near" the flagstick is deemed to be attending it. This is vague, so Decision 17-1/1 states that anyone close enough to touch the flagstick is "standing near" it. Decisions may also define the proper procedure in exceptional or unforeseen cases. For instance, Decision 6-6a/4 states when the scorekeeper refuses to sign a card after a dispute about his fellow-competitor's score is decided by the committee in favor of the fellow-competitor, there is no penalty; the scorekeeper should not attest to any score he believes incorrect even if he is overruled, but the score may be attested by another witness, or may be accepted by the committee without being attested. Decisions may also rule that specific actions, equipment or fixtures used by a player or implemented by the committee or course are legal or illegal; for instance, most decisions regarding Rule 14-1 define specific actions that are and are not "fair" swings at the ball, and general Decisions on rule 17 define alterations to a flag or attachments to the flagstick that may be made by the course authorities to indicate the relative position of the hole on the green, or aid in distance determination.
These decisions are binding in situations where they apply, as they define the proper implementation of the Rules themselves. They are not included in most rulebooks, but like the Rules they are available for reference on the USGA website.
The biggest change that came with the 2008–2011 edition was a new rule about clubheads not having too much 'spring' effect. This has led to the publishing of lists of conforming and non-conforming drivers.
In 2010 a new rule governing grooves came into force for professional and high-level amateur competition. The change was made in order to decrease the amount of back spin that players were able to produce, particularly from the rough. However, due to a previous legal settlement with Ping following an earlier rule change in the early 1990s, their Eye 2 irons, which were otherwise non-conforming, were deemed legal. This led to a controversy in the early stages of the 2010 PGA Tour season when Phil Mickelson used these irons. While Mickelson's use of the irons was ruled legal, Ping decided to surrender its remaining rights under the now-20-year-old legal settlement, and the original Ping Eye 2 sets are now officially non-conforming. Ping continues to produce a set of wedges with this name and general shape, but these new Ping Eye 2 wedges have conforming face and groove designs.
The 2012–2015 edition was published October 24, 2011. Nine rules were changed, the most significant being Ball Moving After Address (Rule 18-2b). Rory McIlroy was penalized by this Rule in the final round of the 2011 Open Championship.
The 2016 edition added Rule 14-1b, which forbids players from anchoring a club against their body in any way (such as directly against the body or by using their forearm to create an anchor point back to their body). While the rule change is expected to prominently affect the users of long putters, the two governing bodies stated that "the proposed rule narrowly targets only a few types of strokes, while preserving a golfer's ability to play a wide variety of strokes in his or her individual style."
On April 25, 2017, Decision 34-3/10 was issued, which limits the usage of video footage as evidence of certain infractions if the infraction "can't be seen with the naked eye", or the player had done "all that can be reasonably expected to make an accurate estimation or measurement" in order to correctly play or spot their ball, even if video evidence suggests otherwise. Although the sanctioning bodies stated that this was part of an effort to update and modernize the Rules, media outlets considered the ruling to be a response to an incident from the 2017 ANA Inspiration tournament, where Lexi Thompson was retroactively penalized four strokes from her third round score for mis-placing a ball, as reported by a television viewer, going as far as nicknaming it the "Lexi Thompson rule".
Following a lengthy consultation process, the Rules of Golf were completely rewritten and updated with many significant changes, including to some basic terminology. Notable changes included dropping from knee height (previously shoulder), putting out on the green with the flagstick left in (previously incurred a penalty), a defined relief area , reduced search time (3 minutes instead of the previous 5) and ability to repair spike/shoe damage on the green. The new rules came into effect on January 1, 2019.