The kilometer is used as a unit used to measure distances or lengths.
It's a standard measure for travelled distances, geographical distances and maps in most countries excluding the USA and the United Kingdom where mile is still used for this purpose.
between geographical locations on land, and in most countries is the official unit for this purpose. Primary exceptions are the United Kingdom, Liberia, Myanmar and the United States of America, where the mile remains as standard as a part of imperial system.

Definition of the Unit:

The kilometer (kilometre in UK spelling) is a unit of length/distance in the metric system (SI Unit system) equivalent to one thousand meters.

Although the meter was defined in 1799 in France, the kilometer was first adopted for everyday use by the Dutch in 1817 under local name of the mijl. The myriametre (10000 meters) and "lieues de Poste" (Postal leagues, 4288 meters) were preferred to the "kilometer" for everyday use in France in 19th century. In the mid 19th century the kilometer was already in everyday use in the Italy and in Netherlands and the myriametre was still in use in France.
The CIPM (The International Committee for Weights and Measures) officially abolished the prefix "myria-" and the "myriametre" in 1935, leaving the kilometer as the recognised unit of length instead of myriametre.

Where it's used:

The kilometer is commonly used on road signs to indicate the distance to travel to a given location, on maps to indicate scale, for odometer indication in automotive industry. It is also the most popular unit for describing the distance between geographical points and locations.