You want a hat to be about 2" less than the actual head size so it stays on. At 5 sts per inch that would be 100 sts. But the larger your sample, the more accurate your gauge, so 10sts maybe wasn't enough to see if it was actually 5 sts/inch or 4½. Also sometimes we purl tighter or looser than we knit, so when you work in the round without purling, your gauge isn't going to be the same as knitting flat. Measure the actual hat to see what your sts per inch really are. Then cast on less stitches to aim for 20" or so.
sue- knitting heretic