Gandalf is the name of a dwarf in the Norse Poetic Edda (from which Tolkien borrowed a bunch of names, mostly dwarves). He supposed – probably accurately – that it meant "wand-elf", but he originally gave the name to Thorin.
It's a hunting horn that happens to be carved from an elephant tusk so it's all tied together.
It got the name because in the story of Roland he had a hunting horn like that apparently named Oliphant that he blew to summon aid from the rest of Charlemagne's forces after he got his army killed by not blowing it sooner, because he was a fucking idiot.
That or that was just the word for that kind of horn and the texts just make it seem like that was a specific name, it's hard to tell sometimes.