The idiom “down to the wire” means waiting until the last minute to do something.
Example of use: “I went partying yesterday and forgot that I’m supposed to submit my paper tomorrow. It’s gonna be down to the wire and I’ll have to pull an all-nighter to finish it on time”.