When installing a chimney for a wood stove the chimney needs to extend above the roofs surface a minimum of 3 feet and also 2 feet above any roofline it penetrates.
A wood stove also needs to be kept at a minimum clearance of 12 inches from a wall if the wood stove contains a heat shield and a minimum of 36 inches without a heat shield.
So make sure that you have the chimney standing 3 feet above the roof ridge to be safe and meet code.