Here's a very simple mattebox which is really just a sunshade, so no filter stages
A more full sized, full featured but still fairly affordable matte box:
A matte box serves two functions: Block stray light from hitting the lens, and to hold square lens filters.
Let's start with lens filters, because i can sense you might be wondering what the difference would be to just using the good old screw on circular filters. Now i'll admit, i am a circular filter user, but mainly because i don't use filters all too often so i consider it less hassel to use a lens shade and screw on filters instead of mounting up a matte box which needs a rail system to mount to.
But that being said, many people will find great use in square filters because of a few advantages. For one, they mount to the matte box and not the lens, so if you have several lenses to use on a shoot, when you swap out a lens you don't need to unscrew a filter and rescrew it into the other lens. They just stay in the matte box and that does save you quite a bit of time. Another advantage is that square filters work with nearly all lenses, unlike screw in filters which either need a separate filter for each size lens thread, or adapter step up rings. So you might consider money saved in only having to buy 1 of each type of square filter that will work with your entire lens collection.
Blocking stray light
Now about controlling the light, which is just as important as the filter holders. You want a matte box that comes with a french flag(the top) as well as side flags. Some even have a bottom flag, but they are usually not necessary.
Features to look for
Height adjustment: You want to make sure that the matte box sits at the correct height so it matches up with the lens, and many matte boxes have a height adjustment which i would say is pretty much invaluable so try to get a model which has that feature.
Swing away: is also very nice and will save you time, it makes it so that you don't need to tighten and slide forward the matte box to change a lens. Instead you can just un-click the swing hinge and it gets right out of your way.
Number of stages: Another thing to look out for is how many filter trays there are, known as stages. Do you need 2? 3? Do you need rotating stages for your polarizers? etc...
You don't need to spend a lot of money to buy a matte box these days, and depending on your needs you may do fine with the super basic model linked above. I usually run without one, but that's just my particular needs. If you want to run light, there are also these nifty little hoods which are good to keep around just in case.