At 40,000 ft. air resistance becomes important, as the object will likely reach terminal velocity and greatly increases the time it takes to reach the ground. Also, the horizontal velocity comes into play as the terminal velocity caused by air resistance is actually a terminal speed, so it's the resultant that counts.
The shape of the object is not specified, so any calculation of the terminal velocity remains an estimate with assumptions.
If you have not done air-resistance and terminal velocities, read on.
Neglecting air resistance, the horizontal velocity of the plane does not count, and you can calculate the time required as if it were a free fall over short distances.
vi=initial velocity (0)
t=time in seconds,
g=acceleration due to gravity, 32.2 f/s^2
S=vertical distance travelled = 40,000 ft
40000=0*t + (1/2)*32.2*t^2
Solve for t to get:
t=50 sec. approx.
(remember: this is by ignoring air-resitance)