The type of fabric you are using will dictate what stitch setting to use on your sewing machine. For example, if you are working with a delicate fabric, you will want to use a smaller stitch so that it does not tear the fabric. On the other hand, if you are working with a heavier fabric, you will want to use a larger stitch so that it can hold everything together.
There is also the matter of straight or zigzag stitches. Straight stitches are just that- straight. They are typically used for seams and hems. Zigzag stitches have, well, a zigzag pattern and they are typically used for appliques or decorative stitching.
The tension on your sewing machine also needs to be adjusted depending on the type of fabric you are using. The general rule is that the lighter the fabric, the higher the tension should be. This keeps the thread from pulling too much of the fabric through and causing it to pucker. Conversely, when working with heavier fabrics, you will want to lower the tension so that more thread is pulled through and creates a stronger seam.