A building permit is a document of permission issued by your local building department. There are different rules depending on where you live, but the rule of thumb is if you are altering part of the structure of your house, you need a permit to do so. When in doubt, ask your local building authority. If you don't have a permit and you're found out, they can shut your project down in mid-hammer. Some cities are more lenient than others, but in some places, the housing authority drives around looking for houses with active projects and no posted permit.
The purpose of a permit is to make sure everything is being done correctly and safely. It may be a pain to do so, but you need to apply for a permit if you're diving into a major DIY project. What's required to obtain a permit also varies, but you'll probably need to provide your plans, a detailed work outline and approval by an architect or engineer. The building department will review the materials and then decide whether or not your plan meets local codes. If you pass, you get a permit, pay a fee based on the size of your project and get to work. If you don't, it's back to the drawing board, and you can resubmit.