Sound is a compression wave, that is the air vibrates in a direction along the direction of the wave. I found this image that shows you what a standing sound wave looks like in a half open pipe (nicked from this site). The black dots represent some small volume of the air:
The key point to note is that there are some points where the air is not moving, called nodes, and some points where the air motion is at a maximum, called antinodes.
At the closed end of the pipe the air cannot move, obviously so because the end of the pipe is in the way. This means there must be a node at the closed end. In contrast at the open end of the pipe the air can move, and in fact for a standing wave to form at an open end the wave must have an antinode.
So for a closed pipe, as in the picture above, we have a node at one end and an antinode at the other, and the distance between a node and antinode is $(2n + 1)\lambda/4$, where $n = 0$ gives you the fundamental, $n = 1$ is the first overtone and so on (the diagram actually shows the fifth overtone). For the fundamental frequency, $n = 0$, the length of the pipe is equal to $\lambda/4$ so the wavelength is four times the length of the pipe as you say.
If you take an open pipe the air will be moving, i.e. there is an antinode, at both ends. The distance between two antinodes is $n\lambda/2$, where this time $n = 1$ gives us the fundamental, so for the fundamental the length of the pipe is equal to $\lambda/2$ i.e. the wavelength is twice the length of the pipe.