I knitted a hat that seemed ok with the gauge but turned out to have a circimference 3 inches smaller than it should have. I used size 5 on light worsted with a cast on of 96 that should have resulted in 19 but got 16 inches. Should I increase needle size to 6 or 7?
Yes, increase the needle size. You could do a swatch to see what gauge you're getting with the larger needles. Once you know how many sts/inch you get with your yarn, needles and knitting style, you can cast on the correct number of sts for the circumference you want. Also, if you're knitting in the round, you might do the swatch in the round, just in case you get very different gauges from knits and purls vs all knit sts.