Choose the thread size for the effect you want or to suit the purpose of the stitches, and then match the needle size to the thread size.
For piecing, many people like to use finer threads - 50 or 60 or even 70 wt, so they will need a smaller needle - size 12, 11, 10 or 9.
For quilting, you might want to use a 30 wt thread - a size 16 or 18 needle. Or an even larger thread, which will need an even larger needle.
Too large a needle for the thread and the needle may not be able to create a thread loop for the hook to catch - skipped stitches.
Too small a needle for the thread and the thread will shred or break.
You may need to try a few different needle sizes to find the one that gives you the perfect stitch for that combination of threads, fabrics and stitching. :)