This case of a thread stripping is a complex stress system that is not well understood.
Factors involved include the material of the nut and male thread and how they each respond to loads, the quality of the thread both male and female( ie how well they fit together and the surface finish) and the nature of the load applied.
In the UK, professionally guidance would be sought from British Standards as they are supposed to embody whatis considered by the great and the good to be “best practise”.
Have a look at BS3580 “Guide to design considerations on The strength of Screw Threads” for further information, particularly appendix A where equations are given to enable a “length oif engagement” to be determined. You should be able to access a copy through a town library or local technical college library.
Sorry if this reads as a “cop out” but if you are designing something critical it could have serious consequences.
Practical rules of thumb generally indicate that a length of engagement equivalent to the thread diameter would give failure in tension rather than stripping, however don’t forget that chamfers on the male and female threads reduce the effective engagement.
The late Professor Chaddock published some data on bolted joints through the Design Council that might be useful too.
Best wishes
John