Overall length isn't critical, enough to grab hold of while you are screwing on and unscrewing, say 4". The end of my studs are about 1" into the hub, and about 1.25" threaded length, So allow say 1/2" to screw the nut onto the end of the stud, then cut the slot so it is level with the end of the hub, say 1.5" from the end of the nut. That leaves plenty of thread to screw the tool further onto the stud, to keep the lever at right-angles to the tool, if you need two or three goes at levering.
The tool screwed onto the stud such that the lever makes a right-angle to it, to give a straight pull on the cap. If the lever is too far away from the right-angle it will tend to push the cap to one side or the other instead of levering it off with a straight pull.