user4014: In a 5-minute match a player makes an illegal move leaving his king in a check position. This usually gives the victory to the opponent, if he sees it and captures the king.
Otherwise, if the opponent doesn't claim the illegal move within 2 moves, the game just continues as if nothing happened.
But what happens, if the opponent runs out of time just before he captures the king?
Is it a time win, since the opponent didn't claim the illegal move within his time limit?
Or does the illegal move automatically lose, once it is noticed?
If the illegal move automatically loses, that raises the following theoretical question:
What if nobody immediately sees the illegal move, and the game is considered to be lost on time. But after a while the opponent notices the illegal move and claims it. Is there a time limit to that, and how is it enforced after the clocks have stopped ticking?
And lastly, would the decision be any different, if the match was longer/shorter?

user4093: When an illegal move is completed once the opponent’s clock has been started. The opponent is entitled to claim a win before he has made his own move. However, if the opponent cannot checkmate the player’s king by any possible series of legal moves, then the claimant is entitled to claim a draw before he has made his own move. Once the opponent has made his own move, an illegal move cannot be corrected unless mutually agreed without intervention of an arbiter.
As far as the time/check priorities go... As far as I'm aware(and in any tournament I have played in thus far) any player that is first to claim for a win will win the game, UNLESS both flags have fallen in which case it becomes a draw. It is part of the game(especially in blitz) for a player to be aware of the clock and there is no default loss when a player's time hits 0 unlike online chess where this is done automatically.
EDIT:
Since someone wanted a conclusive pointer to a rule that enforces this... which took a while it is found in the fide rulebook which can be found at http://www.fide.com/component/handbook/?id=124&view=article 
There is also a short section regarding blitz(which is less than 15 minutes) which seems to handle the same format.



4014: <p>In a 5-minute match a player makes an illegal move leaving his king in a check position. This usually gives the victory to the opponent, if he sees it and captures the king.
Otherwise, if the opponent doesn't claim the illegal move within 2 moves, the game just continues as if nothing happened.</p>

<p>But what happens, if the opponent runs out of time just before he captures the king?
Is it a time win, since the opponent didn't claim the illegal move within his time limit?
Or does the illegal move automatically lose, once it is noticed?</p>

<p>If the illegal move automatically loses, that raises the following theoretical question:
What if nobody immediately sees the illegal move, and the game is considered to be lost on time. But after a while the opponent notices the illegal move and claims it. Is there a time limit to that, and how is it enforced after the clocks have stopped ticking?</p>

<p>And lastly, would the decision be any different, if the match was longer/shorter?</p>
 4093: <p>When an illegal move is completed once the opponent’s clock has been started. The opponent is entitled to claim a win before he has made his own move. However, if the opponent cannot checkmate the player’s king by any possible series of legal moves, then the claimant is entitled to claim a draw before he has made his own move. Once the opponent has made his own move, an illegal move cannot be corrected unless mutually agreed without intervention of an arbiter.</p>

<p>As far as the time/check priorities go... As far as I'm aware(and in any tournament I have played in thus far) any player that is first to claim for a win will win the game, UNLESS both flags have fallen in which case it becomes a draw. It is part of the game(especially in blitz) for a player to be aware of the clock and there is no default loss when a player's time hits 0 unlike online chess where this is done automatically.</p>

<p>EDIT:</p>

<p>Since someone wanted a conclusive pointer to a rule that enforces this... which took a while it is found in the fide rulebook which can be found at <a href="http://www.fide.com/component/handbook/?id=124&amp;view=article" rel="nofollow noreferrer">http://www.fide.com/component/handbook/?id=124&amp;view=article</a> 
There is also a short section regarding blitz(which is less than 15 minutes) which seems to handle the same format.</p>

<p><img src="https://i.stack.imgur.com/umauI.png" alt="Fide rules regarding rapidplay"></p>

<p><img src="https://i.stack.imgur.com/RICUa.png" alt="enter image description here"></p>
