The wavelength is the distance between one crest/trough to another crest/trough. On the image, it's basically the length between each peak of the wave. You can see that the distance between peaks in wave A are much shorter than the distance between the peaks in wave B.
Thus, wave B has the longer wavelength.