In this paper, the electrons energy spectrum produced by stochastic acceleration in the interaction of an intense laser pulse with the underdense plasma is described by employing the fully kinetic 1D-3 V particle-in-cell simulation. In this way, two finite laser pulses with the same length 200 fs and with two different rise times 30 and 60 fs are typically selected. It is shown that the maximum energy of electrons in the laser pulse with the short rise time (30 fs) is about eight times greater than the maximum energy of the electrons with the long rise time (60 fs). Furthermore, unlike the pulse with the short rise time, the shape of energy spectrum and the electrons temperature in the long rise time laser pulse are approximately unchanged over the time. These results originated from the fact that in the case of long rise time laser pulse, all electrons are accelerated by the one chaotic mechanism because of the scattered fields generated in the plasma, but in the case of short rise time laser pulse, three different mechanisms accelerate the electrons: first, the stochastic acceleration because of the nonlinear wave breaking via plasma-vacuum boundary effect; second, the stochastic acceleration initiated by the wave breaking; and third, the direct laser acceleration of the released electrons.