Boiling the wort is necessary to kill any wild yeasts or bacteria that could outcompete beer yeast and spoil the beer. It goes hand in hand with hopping, since most hops will be added in the boil, but that will be covered in the next section.
Boiling wort also drives off dimethyl sulfide (DMS), a compound that forms corn- or vegetal-tasting compounds in the beer. Most worts will be boiled for at least 60 minutes to drive off DMS, but can also be boiled longer. Worts using Pilsner malts are recommended to be boiled for at least 90 minutes since the lightly-kilned malt contains higher amounts of DMS precursors than other malts. Boils should also be uncovered, otherwise DMS that is boiled off will accumulate in water droplets on the lid and fall back into the beer.
When boiling wort, you need to take into account your boiloff rate, the rate at which water evaporates during the boil. Since you'll want to end up with 5 gallons of beer (or whatever size batch you're targeting) you need to ensure that you have a sufficient amount of wort to begin the boil. For the most part you'll have to figure this out through trial and error, but there are some steps you can take to make it a little easier. The first thing you'll want to do is find out your boiloff rate, the rate at which your wort evaporates as you boil it.
In order to find out your boiloff rate, you first need to know the volume of your boil kettle. For a 5-gallon batch of beer I recommend at least a 10-gallon boil kettle, otherwise you'll risk a boilover when your wort gets up to boiling temperature. Cleaning up sticky, scorched wort from your stovetop is not fun, it smells pretty bad, and it wastes a lot of what could have been good beer.
Back to calculating the boiloff rate. Fill up your boil kettle with a known amount of water, say 5 gallons. Or fill it with 7-8 gallons, since that's how much wort you'll likely be adding when you brew. Measure the depth of water with a ruler, along the side of the kettle. That gives you a rough conversion for the number of inches or centimeters in the kettle per gallon of water. Then bring the water to a boil. As you pass through the 140-150 degree range, which is where your wort will be when you put it in the kettle, measure again. Water expands as it heats (online calculator to calculate thermal expansion here), not by a lot, but you should take that into account.
Once you're at a good rolling boil, measure the depth again. Boil for 30 minutes and measure the depth again. Repeat this after another 30 minutes, and then again after another 30 minutes, just to make sure that your water boils off at an even rate over the 90 minutes of a possible boil. And if you're really picky, you can even let the water cool back to room temperature and measure the depth again, as a final check. These numbers don't need to be 100% accurate, 98% is fine, as we're dealing with volumes so small that a few ounces of water here or there won't make too much of a difference. You just want to be in the general ballpark. And after a few batches you'll have done enough trial and error to be able to dial things in pretty well.
A 10-gallon boil kettle is large enough that you'll probably need to use two stove burners to get your wort up to boil in a decent amount of time (less than 30 minutes). It helps to know the BTU output of each of your burners. The stove I started on had 4 burners, each at 10,000 BTU rated output, and the grates were fairly low so that the kettle was pretty close to the flame. We just got a new stove a few months ago, with one "turbo" burner rated at 15,000 BTU, one diagonally across from it at 12,000 BTU, and two simmer burners at 5,000 BTU. The new grates make it easier to move the kettle around, but they sit much higher off the flame, which I'm certain leads to significant heat loss. Even using the 15K in combination with a 5K, I have to cover the kettle in order to get it to a boil. And instead of the roiling, rolling boil I had before, I get what looks to be barely a simmer. The benefit is that because the boiloff rate is significantly lower for the new stove, I don't need to use as much water when I sparge. So instead of targeting 8 gallons of wort to begin the boil, I now only need about 7 gallons.
Now that you have your boiloff rate you can figure out how much wort you need to start off with. I keep a detailed spreadsheet of each of my brews, and I calculate the amount of water lost to grain in the mash. Normally it's between 0.115 and 0.125 gallons of water lost per pound of grain you use, but some grains absorb more water and some less. I measure the amount of wort in my boil kettle with a ruler to see how many gallons I've ended up with, and adjust accordingly from brew to brew if I start noticing discrepancies. I have a boiloff rate of 5/6 gallons per hour, or 1.25 gallons over the course of a 90-minute boil. I also generally leave a lot of my trub (sediment) at the bottom of the kettle, so I estimate some loss there. Once fermentation begins I estimate even more loss as the yeast reproduces and absorbs water. And when I transfer and bottle the beer I'm not able to get every last drop out of the carboy, so I estimate 3/4 to a full gallon of liquid loss over the course of that whole post-boil process. In order to end up with 5 gallons of finished beer, I need to account for 2-2.25 gallons of water lost throughout the entire process, meaning that 7 gallons of wort is the bare minimum I need to start with.
With regard to sediment after the boil, you'll have hot break, cold break, and hop solids. Hot break are proteins that coagulate as the wort heats up to a boil. You'll notice the wort starts to get a foamy head as it heats up. This foam expands until the boiling point is reached, at which point air bubbles pierce the foam and the head collapses. This is why you need to use a large kettle, especially if you're covering it while heating, because you don't want this foam or any of the wort to boil over and create a mess.
Once the boil has been reached you will often see little bits of protein solids all throughout the wort. Very often it almost looks like egg drop soup. You'll get even more proteins coagulating once the wort is cooled. And of course when you add your hops, they will absorb water and you'll be left with hop residue at the bottom of your wort. But I'll cover all of that in the next couple of chapters on hopping and wort chilling.