In cricket, a team's innings usually lasts until 10 of the 11 batsmen in the team are out, leaving the not out batsman without a partner and thus unable to continue, or until another event intervenes (such as the captain of the team declaring the innings closed for tactical reasons; or the time allotted for the entire game expiring).
In First-class cricket and Test cricket, each side has two innings. In one-day cricket and other abbreviated forms of the game, an innings lasts only for a set period or for a certain number of overs (typically 50 in one-day cricket and 20 in Twenty20 cricket). Note that "an innings" can mean a particular side's innings (Sri Lanka made 464 in the third innings [of the game]) or that of both sides (England had the better of the first innings, outscoring Australia by 104), or that of an individual batsman (Bradman was out for a duck in the final innings of his career), the difference being understood by context.
An individual innings usually lasts until the batsman is given out, or until the end of the team innings. Although batsmen bat together in pairs, this combination is never called an innings: it is a partnership or a stand.