Femtosecond laser excitation of nonlinear materials is one of the key technologies for generating terahertz waves at present. Due to its advantages such as ultrashort time resolution and ultrabroad frequency spectrum, the technology has been widely used to characterize, measure, sense and image terahertz waves. However, the methods of controlling terahertz waves through microstructures can only regulate their transmission process, and they will face obstacles such as design difficulty and complex processes, making it hard to be widely used in industry. In this work, by introducing a pulse-shaping system to change the time dispersion of femtosecond laser pulses, the interaction process between femtosecond laser and lithium niobate crystals can be directly regulated, therefore the terahertz generation process can be directly controlled. Taking the second-order time dispersion for example, the terahertz signals generated by pump light with different second-order time dispersion in lithium niobate is detected by using the pump-probe phase-contrast imaging system. Meanwhile, the generation process of terahertz waves is simulated using the impact stimulated Raman scattering model and Huang-Kun equation, demonstrating the feasibility of using femtosecond laser pulses to adjust the time dispersion of terahertz waves. The experimental and simulation results show that when the time dispersion of femtosecond laser causes the pulse width to increase, the time in which the lithium niobate lattice is subjected to the impact stimulated Raman scattering force is prolonged, and the macroscopic polarization of the lithium niobate lattice is correspondingly extended. On the one hand, the longer duration of polarization results in a wider terahertz signal in the time domain and a narrower one in the frequency domain. On the other hand, since the impact stimulated Raman scattering force is proportional to the pump light intensity and is in the same direction during the interaction time, when the Raman scattering force ends, the lattice reaches a maximum displacement. The longer Raman scattering force causes the lattice to move to one side for a longer time, and correspondingly, the subsequent vibration of one period takes a longer time, ultimately resulting in a lower center frequency. In addition, this work also points out that the modulation of terahertz signals by pump light pulse width may be affected by the thickness of the wafer, and the modulation effect on thinner media may be more obvious. This result is of great reference significance for the active regulation of on-chip terahertz sources based on lithium niobate crystals in the future.