What is the relationship between temperature, dew point and the formation of clouds?
The dew point is the temperature at which condensation (a cloud) forms.

If the dew point is the same as the temperature on the ground, then there will be fog.

The temperature usually decreases as the altitude increases. This is called the lapse rate. In general, the closer the dew point is to the ground temperature, the lower the cloud ceiling will be.