This depends on what kind of pull-ups you want to do. If you just want to do regular pull-ups then you only need a gap of around 2 feet so you can get your head over the bar. If you want to do a full muscle up though (where your body is above the bar) then you will need more like 4-5ft of clearance above the bar.