There are two answers to this:
1. You work to the dimensions given in a thread chart eg Machinery's Handbook, etc.
2. You set up with the outer diameter turned to the nominal size (eg for a 6mm screw, you need a turned 6mm cylinder to start with). Then you cut a thread in the conventional way but not so deep that you cut away the outer diameter at all, you need to leave a narrow land between the grooves you cut. Then try a nut which is the same thread. If it goes on nicely, bingo. If it goes on and wobbles about, start again and make your first thread cut less deep. Most likely, the nut won't go on. So, deepen the thread a small amount* and try again. Keep doing this until the nut will go on, and you are there.
* follow the instructions for your lathe, to ensure that the second cut of the thread follows the first. This usually means leaving the lead-screw engaged until the job is finished, winding the tool-post back by reversing the lathe, and not by loosening the clasp-nut. On some machines there is a separate indicator which will tell you at what stage to engage the clasp nut, but the safest for a beginner is to leave it all engaged and wind back.
I do hope this makes sense to you
Regards, Tim