The gaffer is an electrician who manages the lighting in a film production. This position is both technical and creative — responsibilities can include everything from setting up portable generators to creating certain mood effects with lights.
In television this position is often referred to as the chief lighting technician.
The origin of the term "gaffer" is the subject of some debate but it is usually reported to come from early film days when studios relied on natural sunlight for lighting. Large sections of canvas roofing were opened and closed using long "gaffing hooks". Gaffs are also the name of booms on ships, and many early stagehands were sailors on shore leave.
In Britain, gaffer is slang for godfather or grandfather, or the head of a group of labourers.