Someone's number is up the moment before they die. When used in the past tense, it means they were destined to die at the very time they actually did die. When used in the present tense, it might be a threat to
kill someone immediately.
The phrase is perhaps based on the
Take-a-Number
System, in which customers take a numbered ticket rather than waiting in
line. When the clerk calls out your number, "your number is up", and it is your turn to place your order with the clerk. Of course, the clerk might be the grim reaper instead!