The following two idioms, each in its own way, do convey "the last chance or the last possibility that a person may have or may be given":
shit (or piss) or get off the pot vulgar slang
Used to convey that someone should stop wasting time and get on with
A vulgar expression probably shouldn't escape your bosses lips, but the boss/employee exchange appears to be only a "for instance". Even in such a context, it would not be stretch to imagine a workmate telling you "It's time to shit or get off the pot", implying that there is someone else waiting to take your place, in this case your job.
do or die
Used to describe a critical situation where one’s actions may result
in victory or defeat
This expression definitely does more to capture the "critical situation" specified in the OP and could be worked into that conversation:
Boss: I am not satisfied with your work, so I am afraid it is now do or die for you.
Me: Do you mean this is my last chance or I will be fired?
Boss: That is exactly what I am saying.