Measure the diameter of the barrel where the thread is to be cut. Remember that the diameter normally increases backwards – good to know if you are planning on cutting the barrel before making the thread.
A rule of thumb is that there shall be an edge (shoulder) of 1.0mm at the end of the thread. This acts as a stop and it is also this edge that aligns the silencer with the barrel. Consult your gunsmith – he will know which thread to recommend on your rifle!

Some examples:

A barrel with the diameter of 16mm is normally threaded M14x1 (by far the most common thread)
A barrel with the diameter of 17mm is normally threaded M15x1 (for example Blaser rifles)
A sporter/varmint barrel with a diameter of approx. 22mm normally is threaded with M18x1 but if you want to use the same silencer on other rifles M15x1 is a good alternative.