Most new homes are protected by a 1-year warranty on defects in materials and workmanship, though a warranty is not required by law. Under a new house warranty, the builder is obliged to repair items when contacted (usually in writing) by the homeowner.
Ask about the new house warranty before buying--and be sure to get a signed warranty document. In addtion, be sure you receive a package with product warranties-- the roof, appliances, and so forth-- that are offered by the various manufacturers of your home's materials.
If something goes wrong with these parts of your home, you must contact the manufacturer--not the builder.
Some builders offer an extended new-house warranty, called an "insured warranty." This generally covers any systems-- plumbing and electrical, for example-- for a 2-year period.
It may also warranty the structure for up to 10 years. Insured warranties are acutally issued by an insurance company; your home is covered even if the builder goes out of business.