We present a numerical study of the generation and evolution of a mixed layer in a stably stratified layer of Boussinesq fluid. We use an external forcing in the equation of motion to model the experimental situation where the mechanical energy input is due to an oscillating grid. The results of 2D and 3D numerical simulations indicate that the basic mechanism for the entrainment is the advection of the temperature field. This advection tends to produce horizontally thin regions of small temperature vertical gradients (jets) where the hydrodynamics forces are nearly zero. At the bottom of these structures, the buoyancy brakes the vertical motions. The jets are also characterized by the presence of very short horizontal scales where the thermal diffusion time turn out to be comparable with the dynamics time. As a result, the temperature field is well mixed in a few dynamics times. This process stops when the mechanical energy injected becomes comparable with the energy dissipated by viscosity.