Figure out how many sts per inch you get with the needle you're going to use and multiply that by how many inches around your head measures less 2" and that's your cast on number. You may have to adjust by 1 or 2 depending on if you use a ribbing for your edge. Here's a basic hat pattern
you can use for other measurements, and for a slouch you'd probably want to make it a couple inches longer before doing the decreases. At that point you can try it on to see just how much.