How can we measure the thickness of the Earth's mantle?
You are right...noone ever was able to make a borehole that deep. The two deepest boreholes are about. 12.300 m (40.400 ft) - those are the Kola Superdeep Borehole in Russia and the Al Shaheen oil well in Qatar.

So how do we measure the thickness of our subsurface? Think of the earth as an onion with different layers. Each of those layers (lithosphere, asthenosphere, mesospheric mantle, outer core, inner core) contain different mechanical (and chemical) properties. Due to this it is possible to infer indirectly the depth of each layer by using the travel time of refracted/reflected seismic waves (those come from earthquakes).

As mentioned before, each layer contains different mechanical properties, thus making the seismic velocity different in each layer. So on the border of each layer, those changes cause refraction or reflection if large increases in seismic velocity are involved.

Conclusion: no direct measurements possible, only indirectly derived measurements by the speed of travel from seismic waves.