It depends on the class. If it's something where your teacher is your main lifeline for content, like a humanities or something, I'd advise pretty strongly against going ahead. Instead, go for breadth - teacher talking about the Peloponnesian war? Learn how to spell it, first (

). Then have a look at the relationship between Athens, Sparta and Thebes or the military makeup of the main powers. If you really had a lot of time, I'd recommend scrounging your library for some sweet resources, like in our example, Thucydides'
History of the Peloponnesian War is pretty interesting (no jokes pls).
If it's more like maths and all the content is there in front of you - by all means go ahead if you're confident you can get a good grasp on the material through the textbook. As long as you're still learning everything properly, I'd really recommend going as far ahead as you can because in the end, it's a whole lot less stressful to revise when you've got a sweet, sweet extra four weeks to do it.
I tend to go pretty far ahead in my maths classes all the time. So things don't get messy, I generally start topics with everyone else and pump out all the assigned questions in class time and finish between 1-5 weeks ahead without having to do much at home (seriously what is Further maths even). First priority for all the free time is my summary, then the unassigned textbook questions, then exam questions and calculator programs for Further, or questions from the same topic in the 3/4 textbook for Methods. Same stuff in Software Development, except instead of exam questions I just go over and improve my work until I can't find a better way to do it.
Not so much for Lit or Classics. I'll stay with my class and instead of going ahead I'll harass my teachers (when they're not busy, of course

) for extra information on a topic or ask them annoying questions (like "Hey Amy what are the passages going to be like for our SAC? Oh, a long one, a dialogue and a Chorus? Sweet, does that mean I can guess the passages that will be on the SAC by skimming the text again? No, I promise I'm not actually going to do it - but is it this one?" (Still pretty sure she likes me

))
If you're going to finish the course ahead of everyone, I think 4 weeks is a comfortable number. It gives you plenty of time to do revision while having time to do other stuff (like nothing, for example

). Ideally though, however much the time is that they already give you to study should be plenty to study for exams - it's only really worth finishing early if you're going to use the extra time effectively; otherwise it's nearly a detriment because you have more time to stress out and forget everything.