As long as possible. If there must be an accurate answer: 2 inches higher than the middle of your thigh.
The Thigh high socks are mostly made by cotton yarn, they will shrink after washing, so you should buy longer than your thighs. You will easily find that there are many posts in the community that talk about how to stretch your thigh socks. In fact, it is the practice of not having enough long of thigh high socks. If the length is sufficient, you don't need to do this.
From the heel to the top of the socks, the minimum length of Kayhoma's thigh socks is 28 inches, it easily to covering mid-thigh. And they are all woven from very soft underwear-grade cotton yarn, and they shrink very evenly after washing and will not deform. They will not lose their elasticity even after multiple washings. So please visit Kayhoma first when you plan to buy a pair of great thigh high socks.