I can handle this one! The clouds you are talking about are cumulus clouds (cirrus, and stratus form under different conditions and heights). Cumulus clouds can only form at, what we in the meteorology community call the “lifted condensation level”. Imagine a cube of air on the surface. Let’s say you could lift this cube. Well, as you lift this “parcel”, it will cool and condense, and at some point in the atmosphere, it will become saturated with respect to all the other air around it. This is the lifted condensation level, or LCL. It is at this point that a cumulus clouds will form, given that there is proper upward motion (i.e., there has to be some type of “updraft”.) The flat bottom that you see you can imagine is the LCL, and the cloud can extend past this so long as there is sufficient moisture, and upward motion. It’s pretty cool to be able to actually “see” thermodynamics, isn’t it? The reason the cloud doesn’t extend down past this level is because air warms and drys as it sinks (in fact, the only cloud which forms in downward moving air is mammatus… different process.)
Hope this helps!