A nick is a small cut or mark.
You could nick yourself shaving.
To do something in the nick of time is at the last moment, right at the limit of what is possible.
'We arrived at the airport just in the nick of time.'
Originally a Hitchcock film by the same name, here's the trailer for a very exciting 1995 remake staring Johnny Depp.