Answer: Hello mate!
the name is "doppler effect"
As you may know, the frequency (and hence the wavelength) of the sound determines the pitch.
If you move towards the source of the sound, the wavelenght seems shorter, which means that the frequency is higher, and also the pitch.
In the other case, if you are moving away from the sound, the wavelength seems larger and the frequency smaller, so the pitch is lower.