How and when did 'being fired' come to mean losing one's job?

Solution 1:

to fire in the sense of being fired: Etymonline.com

The sense of "sack, dismiss from employment" is recorded by 1885 (with out; 1887 alone) in American English. This probably is a play on the two meanings of discharge (v.): "to dismiss from a position," and "to fire a gun," influenced by the earlier general sense "throw (someone) out" of some place (1871).

and from the OED

  • fire 1879
  • transitive orig. U.S. slang. To dismiss (a person) from a job or position; to sack.

Solution 2:

There’s a slightly earlier sense of “fired” meaning “eject or dismiss” that just dates to 1877 according to the OED:

She was advised to ‘hire a hall’, and the chairman was asked to ‘fire her out’.
Annals of the Great Strikes in the United States

The OED’s earliest citation in the no-more-job sense is from the 1879 Cincinnati Enquirer (reprinted here):

Professional Slang... Fired, Banged, Shot Out—When a performer is discharged he is one of the above.

The OED connects this to firing a gun: just like a bullet, whoever gets fired is outta there real fast.

Solution 3:

This source, Right Attitudes, admits that its explanation for being fired may be a legend.

...legend has it that the phrase originated in the 1910s at the National Cash Register (NCR) Company.

The founder of NCR, John Henry Patterson, was "quirky". The article states that he was "a food and fitness fanatic and had his employees weighed every six months." This quirkiness makes the following explanation of the origin of being fired marginally more plausible.

The article cites two cases of Patterson dismissing an employee -- one of whom was Thomas Watson Sr., who went on to found IBM -- and then ordering his desk taken outside and set afire.! Thus, although it was the employee's desk that was fired, the phrase was used of the employee.

The article states its source as:

Keynote address by Mark Hurd, then-president and COO of Teradata at Kellogg School of Management’s Digital Frontier Conference on 17- and 18-Jan-2003. Teradata was previously a division of NCR Corporation, the company Patterson founded.