
Somebody had a good innings
Origin in Cricket
The phrase comes from cricket, where a good innings means a player scored well. 
Extended Metaphor
It's often used metaphorically to describe life or career duration, not just death or retirement. 
Cultural Usage
Mostly used in the UK and Australia, might be less understood in other English-speaking countries. 