Every transaction has such parameters as timestamp and deadline. They set the time when a transaction expires (= timestamp + deadline [in minutes]). If a transaction is not included into a block before expiration then the coins go back to the sender.
Confirmation count doesn't influence deadline nor vise versa.
Upon receiving a new block each node checks if it doesn't contain transactions that had expired before the block was generated. If it does then such the block is rejected as invalid.
Deadline is an instrument that is supposed be used to "speed up"confirmations in the future when transactions will compete for a room in blocks.