Terrestrial planets form in a series of dynamical steps from the solid component of circumstellar disks. First, km-sized planetesimals form likely via a combination of sticky collisions, turbulent concentration of solids, and gravitational collapse from micron-sized dust grains in the thin disk midplane. Second, planetesimals coalesce to form Moon- to Mars-sized protoplanets, also called “planetary embryos”. Finally, full-sized terrestrial planets accrete from protoplanets and planetesimals. This final stage of accretion lasts about 10-100 Myr and is strongly affected by gravitational perturbations from any gas giant planets, which are constrained to form more quickly, during the 1-10 Myr lifetime of the gaseous component of the disk. It is during this final stage that the bulk compositions and volatile (e.g., water) contents of terrestrial planets are set, depending on their feeding zones and the amount of radial mixing that occurs. The main factors that influence terrestrial planet formation are the mass and surface density profile of the disk, and the perturbations from giant planets and binary companions if they exist. Simple accretion models predicts that low-mass stars should form small, dry planets in their habitable zones. The migration of a giant planet through a disk of rocky bodies does not completely impede terrestrial planet growth. Rather, “hot Jupiter” systems are likely to also contain exterior, very water-rich Earth-like planets, and also “hot Earths”, very close-in rocky planets. Roughly one third of the known systems of extra-solar (giant) planets could allow a terrestrial planet to form in the habitable zone.