CNC or manual? MANUAL-Standard 60* sharp V thread: Set your compound (with feed handle to your RHS) to 29 1/2*, zero the dial, touch your tool off to your part you're threading, remember the number on your crossfeed, reverse the carriage to the beginning of your workpiece, set your gearing for the thread pitch you want, adjust the spindle speed and engage your feed handle on the appropriate number or line on the threading dial.
For example 3/4" 12 TPI...you have a minimum OD tolerance and a maximum OD tolerance based on root form & needing 65% thread engagement for a working thread...which gives you a range of approximately +.000"/-.020" on the workpiece OD. Generally you turn your OD .002"-.005" smaller than actual OD...for a .750" 12 TPI workpiece, turn your starting OD to .748"-.745". Thread depth (total depth of working thread) on a 12 TPI is approximately .055", again there is a minimum & a maximum tolerance here...remember to use coolant and small feed depths for a good clean thread. Generally, you would cut .005" first, second & third cuts, .004" fourth, fifth & sixth cuts, .003" seventh, eighth & ninth cuts, .002" tenth, eleventh & twelfth cuts, .001" for the remainder til total depth....this is how my old shop teacher would have you do it The fact is, in order to figure out the total depth using the compound feed, since this is how you cut a proper thread manually, you would need to do some trig to figure the leg of the hypotenuse (the long leg of a 90* triangle)...this would be total depth you advance the compound from 0. On a 60* Sharp V thread the compound feed advance will be around .120-125".
If you really want to know all the fascinating stuff behind threading, break out your machinist's handbook.
If you're talking CNC...well, that depends on your machine and it's language, what cycles are available to you, and whether you can program the machine to do what you actually want it to do...