A Moff was a sector governor rank in the Sith Empire, Galactic Republic in its last days, and under the Galactic Empire. Sometimes the title was also a worn by the topmost officials of institutions such as the Navy, Army and Intelligence. 
The name Moff originates from the small Pre-Republic space empires from whence the Galactic Republic emerged; the title was given to Warlords of those empires who decided to join the Republic peacefully instead of fighting. 
As governors, those Warlords ruled de jure their territories, known collectively as the Allied Regions. Eventually these were diminished to Republic sectors, and the titles Moffs and Grand Moffs were diminished to purely ceremonial. 
The concept of assigning Moffs to sectors obviously related to the ancient division of the Republic into a thousand sectors, each with a Senator and a local congress; but the first Moffs seem to have been appointed to control rather larger territories than those for which the Senators were answerable. 
As the Empire made its grip firm, Moffs had been assigned to most of the thousand historic sectors of known space, tightening the Empire's grip on the galaxy. However, a number of further modifications had been made to the system, most notably the creation of a cadre of higher-ranking Grand Moffs, governors-general of a new class of Priority Sectors, also known as Oversectors. 
The best-known Priority Sectors were vast reaches of space, rather similar to the large sectors of early Imperial Moffs, in which a number of existing sectors with their local Moffs were now subordinated to a new Oversector command: Imperial Center Oversector incorporated most of the Core, while Oversector Outer essentially incorporated the whole of the former Outland Regions, and the Bright Jewel Oversector embraced another vast tract of the Rim. 
However, not all Oversectors were created in this way. Sometimes, a Moff was simply promoted to Grand Moff and given additional resources to deal with the threats within his existing sector, and sometimes, a rash of troublesome areas across several adjacent sectors were removed from their Moffs' control and grouped in a new Priority Sector under a new Grand Moff. 
As well as the stratification introduced by the creation of Grand Moffs, further complexity was added to the organization of regional governors by the appointment of Moffs to control areas smaller than the historic sectors of the Old Republic: fortress worlds like Prakith had their own Moffs, and on Imperial Center, even ministries of the planetary administration were incorporated as sectors in their own right.