The way to determine how much to spin is no different from how to determine how much yarn to buy: make a sample. Each construction technique has different yarn requirements and methods for calculating yarn required. Most introductory books cover the topic in detail.
There are many sources of project planning advice for common yarn crafts, but it is often not helpful. Knitting books and knitting shop staff regularly advise knitters on project planning but they are not generally experienced in handspinning. Handspun yarns are often more dense than commercially spun yarns, so a typical estimate of "One 50g ball for a hat" is unlikely to be accurate. The spinner, or staff at better knitting stores, can calculate the length of that 50g ball and determine that the desired hat requires 160 m of yarn. But to use this information, the handspun yarn must exactly match the commercial yarn in size.
Some techniques, such as weaving, have clear length requirements but the exact number of warp ends and weft picks to produce the desired result must still be determined by a sample.
Maximum 12 points