You'll need a 6 or 6.5 gallon carboy to provide enough head space during primary fermentation of a 5-gallon batch. If you go smaller, it will be very messy.
Five-gallon carboys are good if you plan on racking to secondary to let the beer condition. During secondary, there will be little to no foam on top ("krausen") so the head space isn't needed. In fact, some HB'ers feel that the smaller headspace is slightly advantageous in minimizing oxidation after racking.