Sound is a mechanical wave that travels through air or another medium as a series of alternating compressions and rarefactions. The frequency is the number of cycles per second that a wave completes. Therefore, the wavelength affects the frequency as it controls the number of cycles completed in a given time.
Pitch is a subjective psychological perception of the wavelength as experienced by a person. The higher the frequency, the higher the pitch will be. This means that a sound with a shorter wavelength will have a higher pitch because there are more cycles completed in a shorter amount of time.
In summary, a shorter wavelength corresponds to a higher frequency and a higher pitch, while a longer wavelength corresponds to a lower frequency and a lower pitch.