In the film Smeagol found the ring, went in the mountains and turned into Gollum. At the time when Gollum followed the Fellowship of the Ring, Gandalf called him Gollum. Who gave him this name, or why do the others call him like that?
From The Hobbit. It's a verbal tic he's developed.
Suddenly up came Gollum and whispered and hissed: "Bless us and splash us, my precioussss! I guess it's a choice feast; at least a tasty morsel it'd make us, gollum!" And when he said gollum he made a horrible swallowing noise in his throat. That is how he got his name, though he always called himself 'my precious.'