Obviously cloud is caused to form by a number of different factors (some mentioned above) and certain of these are difficult to calculate.
Tinstaafl and the next post are correct in the basic manner of calculating a cloud base. Their equations are commonly reduced to:
Temp - dew point x 400 = approx. cloud height
Good for CAA exams but not terribly reliable in real life.