Here's what I usually do: First measure the OD of the thread, but keep in mind that the actual OD will be a little bit smaller than the nominal thread size. It would help if you know whether it is inch or metric thread. Next you'll need to measure the pitch. With calipers you can try to measure the distance between threads, or to be more accurate you can measure the distance between 5 threads and divide by 5. If you have an optical comparator you can get a much more precise measurement. If it is inch threads then what you really need to know is threads per inch, take 1 divided by that pitch value and that will tell you your threads per inch. Most likely your measurement wasn't perfect but this will give you a ballpark idea and you can look up on a thread chart what the closest standard thread size is and that is probably it.
For example I have a screw here, and the OD measures to .247, so I can assume it is a 1/4 thread. Next with calipers I measure 5 teeth and it was about .26". So that would be .052 per thread, or 19.23 threads per inch. I can look on a chart and see that 1/4-20 is a standard size, so that's what this most likely is.
As a final check, if you have screw lying around with the thread that you suspect the part is, you can put the parts together so that the teeth mesh. If they mesh perfectly then the pitch is the same, it they won't mesh together then they have different pitch.
Here is a neat little trick I learned from a machinist but it only works for inch numbered screws sizes 0 thru 12.
If you want to know the diameter of the thread
screw number x 13 + 60
So for a 10-32 screw it would be:10 x 13 + 60 = 190
move the decimal three places to the left and there is your number (which you would be .190)
If you can measure the diameter of the thread and want to know what number it is
measured diameter - 60 / 13
So if you measured the diameter of the thread as .195 remove the decimal point and input it as 195
195 - 60 / 13 = 10.384 which would be a #10 screw
The good thing about this is even if it is a little bigger or smaller than it should be you can still get the number screw it is.
Hope this is helpful,