I have been working on a novel, and I've gone around four chapters in. I keep re-reading the first chapters, and I am tempted to edit them. Should I wait until I at least have a finished first draft to start editing, or should I edit as I go?
I suggest you keep going. What you're doing right now isn't editing; it's nervous grooming. You want what you have on the page to be "perfect" so much that it's stopping you from writing anything else.
Write the rest of the book. Put it aside for a few weeks so you can come back to it with fresh eyes. Then do an editing pass.
If you want to re-read what you wrote in your last session just to get your head back into the space of your story, and you fix a few bitty things along the way, that's fine, but don't hack away wholesale if you only have a few chapters done. Move forward.
It's fine to go back and edit, if you're focusing on arc or major plot points. If one of your first key scenes needs to be completely rewritten, have the events change, etc, then going back and doing substantive editing is totally fine. But worrying about flow, word choice, etc is line editing, and you can get stuck in analysis paralysis.
I suggest using Scrivener, which is an awesome tool. Even if you're stuck with Word, you can still skip all over the book, adding whatever scene is stuck in your head, just not as easily. That assumes you have at least a sense of the overall character arcs in your book. Scrivener has a handy annotation tool, so if there's a small but important detail that's changed or needs to be added, you just type in a reminder for later and get back to new scenes.
If you're going to line edit, do it the next day to get yourself back in the flow of the story, and then move on. The main goal is to keep your word count increasing steadily every week. Feel free to skip a day or two, as long as you keep a consistent average pace. Just 750 words a day gets you 90K words in 4 months. A month to plan and a month to edit means you can turn out a second draft every six months. Of course critiques and edits will drag on voer time.
If you're not a plotter at all, and instead just write a bunch of words having no idea what your story is about or what will happen, and later try to corral the 300 or so pages later into a coherent plot with appropriate pacing and arcs, I highly recommend you plunge on ahead. But if you do even minimal planning, you should be able to go back and make annotations or important changes without interrupting your flow.
Make what changes you need to have the story make sense, write short notes for everything else, and then get writing a new scene. Good luck!
There are many different approaches here.
Some people prefer to write the whole book in one, in order, all the way to completion, then come back and edit it all in one pass. This prevents you from procrastinating, and perhaps gives your book a certain cohesiveness and poetry.
At the other end of the scale, some might prefer to work on multiple parts of the book as they go, depending on what comes to them. If a scene or line of dialog comes clear, go and write it. If it's suddenly obvious how to edit a chapter, and your words are coming freely, edit that chapter. This gives you flexibility and fun, but can lead to logical inconsistencies and procrastination.
There are a plethora of other approaches, you have to pick the one that works for you. Be self-aware. Watch out for perfectionism. See what inspires you. See what makes it fun. If you enjoy your characters and can project this onto the page, it will be enjoyable to read.
How I write (which is not necessarily how you should write)
I generally have multiple strands on the go at any one point. Some chapters are just sketches: a few hundred words of dialog and intent. Some are written but not edited. Some are part way edited. Some need to be refactored to take into account a new character trait, tense change or piece of imagery. Some are complete. Nothing is in order.
I use TODOs all over the place to remind myself to come back. I use Markdown and Git to keep track of the confusion and make sure nothing gets lost on the way. I trade meta-critiques with other authors to help find logical inconsistencies.
It's messy, hacky & slow, but lots of fun.
Don't edit as you're writing your first draft!
Here are the two main reasons...
The priority is to get the first draft finished
Going back and editing earlier chapters is an excellent way to never get to the final one. On first draft you just need to steam through to the end. At this stage the important thing is getting the bones of the story out, and tweaking and editing is a distraction.
You will learn so much during the course of your novel, you may end up discarding entire scenes
It will be wasted time spending hours, days or even weeks fine tuning the perfect words, sentences and metaphors when you might have to chuck the entire scene wholesale. Even worse, with that much sunk effort, you may be tempted to keep scenes that need to be cut, because you can't bear the thought of that time being waster, or those darlings never seeing the light of day.