Clearance is defined as the amount of distance you are required to have between your wood stove or fireplace and the surrounding surfaces. The National Fire Protection Association (NFPA) has issued a list of recommended clearances between stoves and various materials that may be around them. Although the NFPA's guidelines are standard, make sure to check with your local building codes or home insurance, because many have their own regulations as well.
In general, NFPA clearance requirements vary depending on how combustible the surrounding material is and what type of stove or fireplace you own. For wood stoves, the floor beneath them must be protected from heat, as well as the floor surrounding the area for 18 inches in all directions. On a fireplace, the NFPA states the distance a mantel must be from the combustion chamber for fire protection purposes.
What does this mean if you're installing a fireplace or wood stove? Get a copy of the NFPA guidelines for yourself, and make sure that you're making allowances for all stated requirements. Check with your local building codes or homeowner's insurance for more detailed rules.
As a general rule for clearances and fire safety, do not alter your stove or fireplace in any way. Don't shorten the manufactured legs, or change the height or depth of the mantel. Your stove or fireplace was designed with the codes in mind, and if it does not fit into your space as it is designed then you may need to consider a different model rather than unsafely altering the one you have.