Welcome to the Wrangler Forum!
First off... you need to know what axles you have and what gears are in them now. Most likely and rear Dana 35 and front Dana 30.
Depending on what gears are in the rear ( assuming its a 35 ) you may need to change the carrier that the gears ride on. If you have 3.73's or numerically higher, you won't need to.... If you have 3.07's ( highly likely) you will need to change the carrier.
OK.... so let's assume you have the above mentioned axles with 3.07's.
The BEST gear selection for the 4.0 with a 5 speed running 33" tires is 4.56 gears. This what I run in my 2004 4.0 5 speed. At 70mph in 5th I turn 2600 rpms... PERFECT. I would highly suggest this gear selection AND get a 39 tooth speedometer gear to correct your speedometer reading incorrectly after the change. Before I changed my speedo gear, 60mph on the speed was 42mph actual by GPS...now I'm dead on.
You will need to change the rear carrier. Depending on what you want, this can range from $125-$900 each. From open to Limited Slip to automatic lockers to selectable lockers.. meaning you can choose to have them open or locked.
As far as rear gears....
Yukon 4.56 sets for the rear I have seen for around $250 and then you need a master install kit that consists of bearings, seals and shims. These run about $100.. give or take.
As for the front gears....
Your carrier you have now will be fine. The Yukon 4.56 gears for the Dana 30 run about $250 and the master install is about $130.
It is NOT for the average shadetree mechanic to do this install.... so plan on buying the parts needed from your professional installer to keep all the warranty and workmanship under one roof. The install can run you $200-$300 per axle.
Most shops will want to get the parts themselves ( their markup) but you are kinda stuck doing this to keep the guarantee and warranty of parts and labor with that shop... otherwise if something fails, they can blame the parts YOU bought from someone else....
So in a nutshell.... the cost you are looking at is around $1500 easy for a regear for all retail parts.... I will say that is a bit low... but gives you an idea....
So find the parts you want EXACTLY (type of carrier and gear selection).... take that list to an installer and get a quote from them for the entire package.
~Todd~ 2004 X 4.0 5 speed---SOLD
4" Lift, 4.56's, 33" Duratracs on M/T Classics
RR SYE, Tatton CV, MML, BL, TT, Dynomax Exhaust
Hella Lighting: Driving, Fogs and H4 E-Codes
... and NEVER will be