Q. Is it a Rule that you must play a stroke within 40 seconds?
A. No. The Rules of Golf place no time limit on playing a specific stroke. However, a Committee may adopt a pace of play policy with certain requirements (e.g., that when a group is out of position and is being timed, each player must play within _____ seconds).
Below you can view videos related to this Rule.
Walking off the final green with an apparent victory
In the final round of the 1957 U.S. Women's Open Jackie Pung walked off the final green with an apparent victory, but before the competition closed, Pung learned that she had mistakenly signed for a 5 instead of a 6 on the fourth hole.