Repointing or rebuilding your chimney
When the bricks are solid and only the joints are going, repointing is the repair, and it's far less work than taking the chimney down. Rebuilding the top, or the whole stack, makes sense when bricks are cracked through, loose or broken across a large area, or the chimney has started to lean. In between, brick repair swaps out the bad units and keeps the rest. I'd rather save what's sound.
What changes the cost of chimney repair
The biggest factor is how much of the chimney needs new mortar, from a few open joints to every face. Height and roof pitch come next, because a tall chimney on a steep roof takes more setup to reach safely. Replacing brick adds work, more so when we have to find brick that matches yours. A cracked crown, waterproofing and any permit add to the total, and some of it only shows once the old mortar comes out.