How to add fog in the compositor in blender 2.79
The cheapest way to do it is just using the Z-depth like the old games in the 90s to 2000s did it.

For that you just scale the z-depth into the desired range and use it as a factor to mix in a fog-color.

Additionally you can add an early cutoff to not have that much fog closer to the camera.

You can play around with all the factors and the mixing types to get the fog you like.



You can also add a power-to math node to make the falloff non-linear.

If you want something more advanced you can add some ground-fog by rendering 
world-coordinate as an additional layer and using world-Z in addition to camera-Z as a factor.

To make it look more realistic you can also add in differently scaled noise-textures based on bands of z-depth (using masks generated with less-than and greater-than nodes).