I don't know well about the role of "with" here.
Native speaker’s answer
Rebecca
Here, "with" is a preposition that shows possession. He is saying that when he woke up, he had (possessed) three days until the deadline. Ex: Go talk to the man with the hat, maybe he can help you. Ex: I was born with curly hair.