The innings (ending with 's' in both singular and plural form) is the term used for the collective performance of the batting side. In theory, all eleven members of the batting side take a turn to bat but, for various reasons, an "innings" can end before they all do so.
Depending on the type of match being played, each team has one or two innings apiece. The term "innings" is also sometimes used to describe an individual batsman's contribution ("he played a fine innings").
The main aim of the bowler, supported by his fielders, is to dismiss the batsman. A batsman when dismissed is said to be "out" and that means he must leave the field of play and be replaced by the next batsman on his team. When ten batsmen have been dismissed (i.e., are out), then the whole team is dismissed and the innings is over. The last batsman, the one who has not been dismissed, is not allowed to continue alone as there must always be two batsmen "in". This batsman is termed "not out".
An innings can end early for three reasons: because the batting side's captain has chosen to "declare" the innings closed (which is a tactical decision), or because the batting side has achieved its target and won the game, or because the game has ended prematurely due to bad weather or running out of time. In each of these cases the team's innings ends with two "not out" batsmen, unless the innings is declared closed at the fall of a wicket and the next batsman has not joined in the play.
In limited overs cricket, there might be two batsmen still "not out" when the last of the allotted overs has been bowled