Bochnia is most noted for its salt mine, the oldest functioning in Europe, built in the 13th century, a World Heritage Site and a Historic Monument of Poland.
The first known source mentioning the city is a letter of 1198, in which Aymar the Monk, Latin Patriarch of Jerusalem, confirmed a donation by the local magnate Mikora Gryfit to the monastery of the Order of the Holy Sepulchre in Miechów.
The discovery of major deposits of rock salt at the site of the present mine in 1248 led to the grant of city privileges (Magdeburg rights) on 27 February 1253 by Bolesław V the Chaste.
In the original founding document, the German name of the town (Salzberg) is mentioned as well, since many Bochnia's residents were German-speaking settlers from Lower Silesia.
Due to its salt mine and favourable location, Bochnia, which belonged to the Kraków Voivodeship, was one of main cities of Lesser Poland.
In the 14th century, during the reign of King Casimir the Great, a town hall was built, a defensive wall with four gates, a hospital and shelter for miners, and the construction of St. Nicolas Basilica began.
In appreciation of Casimir's influence on the development of Bochnia, monument to him was erected in town's market square in the late 19th century.
At that time, many pilgrims from Lesser Poland, Silesia, Spiš and Orava visited the town, to see a miraculous painting of St. Mary, kept at a local Dominican church.
In 1867, Bochnia County [de; pl] was created and the town began a slow recovery spurred by construction of the Galician Railway of Archduke Charles Louis.
During the German invasion of Poland, which started World War II, on September 6–7, 1939, Bochnia was defended by several Polish units.
The entire Jewish community was murdered in the Holocaust apart from 200 forced laborers employed at a plant headed by Gerhard Kurzbach, a Wehrmacht soldier, who ordered them to work overtime and thereby saved them from deportation.
Bochnia Academy of Economics (Wyższa Szkoła Ekonomiczna w Bochni) is a privately owned collegiate-level institution of higher education in the city, founded in 2000.