Depends.
Some tents have the stove pipe on the outside edge where the tent is short, go too long in this case and you will have an issue with the wind blowing your stove pipe all over.
If its one that comes out of the center of the tent and is supported at the top, you can go much higher.
I run my pipe about 2 ft above the top of the tent. Mine is out of center and is supported by the stove at the base and the tent at the top.
I have a friend who runs an old, canvas, military tent his stove pipe is located on the sidewall of the tipi.
The stove pipe sticks up a good 3.5 - 4 ft above the opening and the wind blows that pipe around like a rag doll.
Often knocks it loose from the stove body and we wake up to a tent filled with smoke.
We tried going with a shorter pipe in his tent, but that has its own issues.
It tends to soot and ash the canvas.
So, I would say depending on what type of tent you have, go short enough to be stable in wind but tall enough to avoid issues with the tent.
I know most manufacturers have recommended stove pipe lengths that they sell with their products.
You might look at the manufacturers website and see what is recommended.