The Fellowship of the Ring, the first volume of The Lord of the Rings, explains that Gollum's real name was Sméagol, and he had once been a member of the secluded branch of the early Stoorish Hobbits.
Gollum left his cave in pursuit of Bilbo a few years after losing the Ring, but the trail was cold.