We investigate the escape of an ensemble of noninteracting particles inside an infinite potential box that contains a time-dependent potential well. The dynamics of each particle is described by a two-dimensional nonlinear area-preserving mapping for the variables energy and time, leading to a mixed phase space. The chaotic sea in the phase space surrounds periodic islands and is limited by a set of invariant spanning curves. When a hole is introduced in the energy axis, the histogram of frequency for the escape of particles, which we observe to be scaling invariant, grows rapidly until it reaches a maximum and then decreases toward zero at sufficiently long times. A plot of the survival probability of a particle in the dynamics as function of time is observed to be exponential for short times, reaching a crossover time and turning to a slower-decay regime, due to sticky regions observed in the phase space.