(Luke was) asleep in his suite in the Imperial Palace, and dreaming of Ben Kenobi.
"No, I'm not a dream," Ben assured him, answering Luke's unspoken thought. "But the distances separating us have become too great for me to appear to you in any other way. Now, even this last path is being closed to me."
"No," Luke heard himself say. "You can't leave us, Ben. We need you."
Ben's eyebrows lifted slightly, and a glimpse of his old smile touched his lips. "You don't need me, Luke. You are a Jedi, strong in the Force." His smile faded and for a moment his eyes seemed to focus on something Luke couldn't see. "At any rate," he added quietly, "the decision is not mine to make. I have lingered too long already, and can no longer postpone my journey from this life to what lies beyond."
So, according to that book (although I know it's not canon, it's far more enjoyable than the prequels), the Force ghosts are similar to our perception of regular ghosts in that they have a strong will to continue to live. It goes without saying that Force training is required to attain that state. But as far as the "immortality" that Yoda is talking about in Revenge of the Sith, well, that's just not the kind of idea that Timothy Zahn had, as even Ben could only hover between worlds for less than a decade after his death before moving on completely.