Gaffer Gamgee was a common nickname for the father of Samwise Gamgee, who was more properly called 'Hamfast'. He presumably acquired the name 'Gaffer' later in his life, because it implies a person of advanced years. This was certainly true of Hamfast, who was old enough to remember Bilbo's return from Erebor, and was no less than ninety-two years old when his son Sam left the Shire with Frodo.
'Gaffer' has another meaning, too, which is no doubt also relevant. In British slang, a 'gaffer' is a foreman, a person who supervises a job. At the time of Bilbo's Birthday Party, we're told that Hamfast, who was then seventy-five, oversaw the gardening at Bag End, but was helped by his son Sam. In that sense, then, Gaffer Gamgee actually was a 'gaffer'.
The name is likely to have been inspired by Joseph Gamgee, the inventor of "Gamgee Tissue" (better known as cotton wool) who lived opposite Tolkien on Stirling Road, Birmingham, England during Tolkien's childhood.