Tidal locking is the locking of one of two orbiting bodies so the same side always faces the other body. The body's rotation period matches its orbital period, which is termed synchronous rotation. It is caused by the effects of the tidal force produced by a body's orbiting peer, on its rotation, which tends to speed or slow its rotation toward a tidally locked state.
Deviation from spherical symmetry (e.g., mountains) can contribute to this type of locking, but even if the planet is, for all intents and purposes, spherically symmetric, tides within a "solid" planet can result in such locking. The difference in gravitational pull on the near and far sides of the body stretches it to create an asymmetry, and any rotation of the stretched body forces the migration of this asymmetry around the it, and the friction of the constant reshaping of the body produces a drag on its rotation. Either the larger or smaller body can be so-locked but it is typical for the smaller body to be locked. The Moon and various other moons of the solar system are tidally locked to their planets.
Being in a tidally locked state affects habitability of a planet, e.g., how much of the surface is of a temperature to hold liquid water, so settling into it can make a planet lose, or possibly gain habitability. The timescale for a (somewhat) Earth-like habitable rocky planet to become locked is on the order of 106 to 1010 years.
No solar system planets are tidally locked to the Sun. Mercury and Venus have been theorized to be so in the past, but current data reveals they are not. Venus has a solar day of 116.75 Earth days whereas tidal locking would result in endless days. Mercury has an orbital resonance with the Sun rotating three times for each two orbits. Orbital resonance is another stable state that can result from the same tidal-force-induced friction, and is sometimes referred to as a type of tidal locking.