If your pattern doesn't state a needle length, then that often depends on you and your knitting style.
Shorter straight needles are good for knitting on the go (20cm). If you like to 'tuck' your needle under your arm, a straight needle length of 35cm or 40cm is best.
If you are choosing circular needles to knit something 'in the round' like a sweater or a cowl, you need a length a little shorter than the circumference of your knitting so your stitches are not stretched round the needle.
If you like to use circular needles, it's also worth learning the magic loop method and buying longer cabled needles (100cm or more) so you can use them on a greater variety of projects. Magic loop allows you to use a long circular to knit small circumferences (eg for sleeves, collars, hats, socks). Even more information about choosing needles can be found in our Guide.