The name Jerusalem in the Bible
There is no town as Biblical as Jerusalem, but it was neither built nor named by Hebrews. Remnants of a Canaanite town called Salem date back to the early bronze age, and the first Biblical mentioning of this place is in Genesis 14:18, where Abraham and Melchizedek meet. The name Jerusalem occurs first in Joshua 10:1 and the city of Jerusalem was conquered, sacked and apparently abandoned by Israel (Judges 1:8). Still, it remained occupied by Jebusites and it was originally located in the territory of not Judah but Benjamin (Judges 1:21). Four hundred years later David conquered Jerusalem from the Jebusites, annexed it and made it his capital (2 Samuel 5:6).
By the time the Hebrews had a say in it, the name Jerusalem had been long established. Most likely, the original name, that sounded something like Urusalimum or Ursalimmu, meant Foundation Of Shalem, the latter being a known Ugaritic god. The reason why the Hebrews didn't rename the city when they had the chance may be because its name was easily transliterated into something very striking in Hebrew (see below).
Jerusalem was built on a hill, which Isaiah calls the Hill of Jerusalem (Isaiah 10:32).
In the New Testament, the name Jerusalem curiously occurs in two distinct forms. About half of the approximately 150 times this name occurs in the New Testament, it is spelled as the neutral plural noun Ιεροσολυμα (Hierosoluma; Matthew 2:1, or Ιεροσολυμων, Hierosolumon in the genitive; Matthew 4:25). Spiros Zodhiates (The Complete Wordstudy Dictionary) supposes this plural is due to an allusion to the two parts of the city, lower and upper Jerusalem. In the other cases our name is spelled as a feminine single noun: Ιερουσαλημ (Hierosalem; Matthew 23:37). A man from Jerusalem is referred to as a Ιεροσολυμιτης (Hierosolumites; Mark 1:5, John 7:25 only).
Note that in Greek and as a fitting coincidence, the first part of our name Jerusalem resembles the words ιερος (hieros), meaning sacred, and ιερευς (hiereus), meaning priest.
Etymology of the name Jerusalem
Without a doubt the second and dominant part of the name reminded (then and now) of the word שלום (shalom), meaning peace. The root of this word, שלם (shalem), denotes completeness, wholeness and soundness:
The first part of the name Jerusalem may likely have reminded a Hebrew audience of the verb ירה (yara), throw, cast or shoot:
Perhaps the name Jerusalem was never changed, but only Hebraized, because it seems to mean Rain Of Peace.
Jerusalem was to be the radiating heart of a world of completeness and wholeness. It seems that history supplied her with a most suiting name.
For a meaning of the name Jerusalem, NOBSE Study Bible Name List reads Possession Of Peace. Jones' Dictionary of Old Testament Proper Names reads Foundation Of Peace.