An inning, or innings, is a fixed-length segment of a game in any of a variety of sports – most notably cricket and baseball during which one team attempts to score while the other team attempts to prevent the first from scoring. In cricket, the term innings is both singular and plural and is always spelled and pronounced with the terminal "s". In baseball and softball, the singular form is inning and only the plural takes an "s".
In many other sports, the length of the game is dictated by a clock and teams swap offensive and defensive roles dynamically by taking possession of a ball or similar item. In baseball and cricket, however, one team, said to be "batting", attempts to score "runs"—see run (baseball) and run (cricket)—while the other team, said to be "fielding", attempts to prevent the scoring of runs and get members of the batting team out. The teams switch places after the fielding team has succeeded in getting a fixed number of players out, making a clock unnecessary.
In cricket, the term innings is also used to refer to the play of one particular player (Smith had a poor innings, scoring only 12). By extension, this term can be used in British English for almost any activity which takes a period of time (The Liberal government had a good innings, but finally lost office in 1972, or You've had a fair innings, now it's my turn, meaning "you have spoken for long enough, now let me speak"). It is also used in reference to someone who has died at a reasonably old age or lived a rich and rewarding life (Ah, well. John was 89. At least he had a good innings). The baseball-derived parallel to this in American English is the term at bat.
According to the Oxford English Dictionary, the term innings has been used in reference to cricket since at least 1735. As cricket was a mature, highly organized sport in the 1600s in England, the term's origin could well precede this first recorded usage. The word inning meaning 'a gathering in' is first recorded in 1522, and could be related.