That's where you need to check clearance height. You could put the computer on it's side, take the side panel off, take off the old cooler. Then, put a straight edge across the sides and use a tape measure straight down to the top of the CPU. Subtract about 1/4-1/2 inch and that's your clearance height.
After that, any decent cooler should list it's height, so make sure you check before you buy it. If you have a 'normal' sized case, as in it accepts full size cards and has some additional clearance above that - you probably have a case similar to a HP I had. In that particular case, lets do some straight up math and use some logic:
It probably takes a standard size DVD/CD, right? Allowing for about an additional 1/2" on each side, we'll assume that one edge of the DVD is even with the motherboard, then allow for 1/4" up from that for the top of the CPU.
So - you have 5.25 inches - .25 inches + .50 inches - total width of 5.50 inches. Converting to mm = 5.5 * 25.4 = 139.7mm (140mm). That means your max cooler height should be under 140mm.
There are many potential good coolers, the Thermalright AXP-100 is a very low clearance unit, and the Noctua C-14 is also quite good. Both should easily clear your case while providing very good CPU cooling.
Of course, get your actual measurement BEFORE buying anything...