As Ducky and Palmer are initially examining the body of the Marine in the morgue, Ducky asks Palmer if he has been spending time with Agent DiNozzo again. After he says this, a crew member can be seen reflected in the doors of the body cooler.
Ducky states that "One can only imagine how long he clawed at the inside of the casket trying to escape before he suffocated." No imagination would be required, especially for a qualified medical examiner. All he needs to do is divide the rate at which he would have used up the breathable oxygen by the volume of air available to him.