Warning! There's a UK/US issue here!
In the UK, "nick" is an informal word for prison. "I just out of the nick" means "I was just released from prison." I'll trust Gareth when he says the word "of" might be omitted. In formal English, you would need to say "out of," but in formal English, you wouldn't say "the nick."
"The nick" for "prison" is not used at all in the United States and wouldn't be understood.
In both countries, the expression "in the nick of time" is used, and it means "just barely in time." In the US we might shorten that, "Whew! I got that done in the nick!"
As a US speaker I was completely baffled when I heard the phrase "in the nick" in British movies. I thought it meant "in the nick of time," but it was clear from context that it obviously didn't.