Light is intrinsically very difficult to store in a small space. The ability to trap photons for a long time (photon lifetime, τph) and to slow the propagation of light plays a significant role in quantum information1,2,3 and optical processing4,5,6. Photonic-crystal cavities with an ultrahigh quality factor (Q) are attracting attention7,8 because of their extremely small volume; however, high-Q demonstrations have been accomplished only with spectral measurements9,10,11. Here we describe time-domain measurements on photonic-crystal cavities with the highest Q among wavelength-scale cavities, and show directly that photons are trapped for one nanosecond. These techniques constitute clear and accurate ways of investigating ultrasmall and long τph systems. We also show that optical pulses are delayed for ∼1.45 ns, corresponding to light propagation at ∼2×10−5 c the speed of light in a vacuum, which is the slowest for any dielectric slow-light medium. Furthermore, we succeeded in dynamically changing the Q within the τph, which is key to realizing the dynamic control of light12,13 and photon-trapping memory14.