How is wavelength actually related to space (/distance)? Is a photon of 400nm in wavelength "smaller" than a photon of 1km in wavelegth?
 A: It can be, but a photon's "size" does not primarily depend on its wavelength: it depends on its bandwidth.
Saying "I have a photon with a well-defined wavelength of 400 nm" means that you have one quantum of energy in an electromagnetic mode with well-defined wavelength. That mode is necessarily a plane wave* and therefore occupies all of space. Well-defined 10 nm photons are as spatially large as 1 km photons - infinitely big.
Of course, this is simply hiding the issue under the carpet, as we never deal with physically infinite systems. In reality, all light pulses will have some 'main' frequency but also a finite extent. That means that their wavelength is not well defined (it cannot be measured to infinite precision, as this requires an infinite number of cycles), and they can be thought of as superpositions of plane waves. As it happens, the shorter the pulse is spatially, the greater the spread in wavelength it will have - the greater its bandwidth.
To put this on a slightly sounder foundation, you can relate the spatial spread $\Delta x$ and the spread in wavenumbers $\Delta k$ with a Heisenberg-style uncertainty relation,
$$\Delta x\,\Delta k\gtrsim1,$$
though it is important to note that this is not (yet) the Heisenberg Uncertainty Principle - it is simply a fundamental property of waves.
Of course, in real life, if you manage to make a source of 400 nm photons, you will likely achieve a spread in wavelength of about that order, or maybe a few times that, but it's unlikely to be as big as 1 km. (Why? it would require your light source to be frequency-stable to the ratio 1 km/400 nm.) Thus your photons will probably be of the order of a few times 400 nm in size. 
(Another more complex possibility is that your photons be very large but lose coherence over a length scale of a few times 400 nm, so that they're only useful single photons over that range.)
Thus, in general, yes, 400 nm photons are likely to be 'shorter' than 1 km photons, but you need to be quite careful with how you define terms and what you are assuming your light sources to be.
*or possibly in some other geometry, without affecting the conclusions.
A: The photon is an elementary particle with energy = $h\nu$, where $\nu$ is the frequency of the electromagnetic wave that will appear if one has an ensemble of a large number of photons.
Otherwise, as a quantum mechanical entity it will obey in space the Heisenberg Uncertainty Principle, 
$$\sigma_x\sigma_p\ge{\hbar\over2}$$
and its spatial extent will be undetermined within the inequality. Since
$$p=\hbar k=\frac{h\nu}c=\frac h \lambda$$
the indeterminacy in space  localization is dependent on  $\lambda/2\pi$.
The wavelength = $\nu/c$ where $c$ is the velocity of light will also manifest in the large ensemble of photons as the classical wavelength. If you become interested on how an ensemble of photons becomes  the classical electromagnetic wave, have a look at this blog entry.

Is a photon of 400nm in wavelength "smaller" than a photon of 1km in wavelength?

It is indeterminate in a smaller length, of order lamda. Indeterminacy means that if one wants to localize a photon's path the localization accuracy cannot be smaller than $\lambda/2\pi$. 
