A direction measured in angular units from some reference line. Also known as an azimuth or a heading.
The reference line could be a grid line, a meridian (longitude line), or magnetic north.
The angular units are usually in degrees-minutes-seconds, decimal degrees, or gons (grads).
While bearing and azimuth are synonyms, there are context-based distinctions:
North American surveyors sometimes distinguish between azimuths as ranging clockwise [0 - 360), and bearings as ranging clockwise or anticlockwise [0 - 90) in four quadrants, N-E, N-W, S-E, S-W.
Geodesists sometimes distinguish between azimuths as measured from a meridian on an ellipsoid, and bearings as measured from a grid line on a plane (map).
Related concepts:
A declination is an angular difference between two different north directions. Typically, a declination diagram illustrates and quantifies the relationships between grid north, true north (the local meridian), and magnetic north.
An orientation, ranging [0 - 180), can be considered to be a non-specific bearing in the sense that a line segment has one orientation but two bearings (depending which end has the "arrow-head").
A deflection angle (sometimes used by surveyors) is a direction measured (left or right) from the forward direction of travel.
A turned angle (often used by surveyors) is a direction measured (left or right) from the reverse direction of travel.
Note for programmers:
In mathematics and computing, directions are usually measured counter-clockwise from the easterly grid line (ie, the +ve X-axis) in radians, so conversions are often required.