mid-13c., "a post in government or administration, an employment to which certain duties are attached, secular position of authority or responsibility," from Anglo-French and Old French ofice "place or function; divine service" (12c. in Old French) and directly from Latin officium "a service, kindness, favor; an obligatory service, official duty, function, business; ceremonial observance" (in Medieval Latin, "church service").
The Latin word was contracted from opificium, literally "work-doing," from ops (genitive opis) "power, might, abundance, means" (related to opus "work," from PIE root *op- "to work, produce in abundance") + combining form of facere "to make, to do" (from PIE root *dhe- "to set, put").
Of ecclesiastical positions from late 14c. From c. 1300 as "official employment" in general, also "ecclesiastical service or mass; the prescribed order and form of church services." Meaning "building or room for conducting business" is from late 14c. Meaning "a government or civic department" is from mid-15c. From 1727 as "a privy."
Office hours "hours of work in an office" is attested from 1841. Office furniture, the type used or commonly found in offices, is by 1839. The political office-holder is by 1818. Office-party, one held for the members of a staff, is by 1950. Middle English had office of life "state of being alive" (late 14c.), translating Latin vite officio.