A very good question, considering that Gandalf is not only a very powerful force on planetary scale, but also immortal.
However, it is the source of his immortality that unlocks this particular riddle.
Gandalf, as all the wizards, is a kind of demi-god sent to counter Sauron and protect the Children of Ilúvatar; the races of Middle Earth as created in song by Ilúvatar and the other Ainur (creators). His original name back in those early days was Olórin. These powerful beings can be killed physically, as Gandalf the Grey was, but if they have further quests to attend to then they can come back in a different physical incarnation (Gandalf the White). Although he is a lesser member of the Ainur, he is closely linked to the land and Earth itself, and feels duty-bound to protect it and the inhabitants.
So our tale begins with the world as it was after the Ring was destroyed and order restored. Peace took hold in the aftermath and Middle Earth enjoyed a prosperous and fast-paced few centuries. Industrial revolution swept the landscape and technology grew in leaps and bounds. The hobbit communities tried to remain islands of uncomplicated agriculture while the Elves and men embraced the future, and Gandalf watched closely to make sure folk didn’t get themselves into trouble again.
During his travels, Gandalf came into the company of a pretty elf-hobbit halfbreed. Never having taken a partner due to the constraints of his immortality and guardianship, he finally felt that there is only so much “YOU SHALL NOT PASS” a man can be bothered with in his life. She was immortal, from her elf lineage, but also possessed the stature and quaint appeal of the hobbits he had been so fond of looking after since the dawn of time. It seemed a perfect match. And Gandalf took this lady as his betrothed, to settle in the Shire and watch over the land from there.
As they built their home and began to consider raising a family in the lull while Middle Earth seemed reasonably danger-free, the Elves and men began breaking away to explore the sky. They launched higher and faster than even the Nazgûl had gone before. The day Gandalf’s son was born, the first live-in space center was sent into orbit. The boy grew fast, and smart, and had a fascination with the new space travel. He wanted nothing more than to journey through the stars. He studied hard at school and it all seemed to come very easily to him; the son of a demi-god and an elf hybrid, he had brains and untrained power in buckets.
The boy grew older, and he learned much from his family. He also began research of his own, wondering what it was that gave him, Gandalf, and the other Ainur their abilities. After many years of humble life on his father’s farm, he discovered the secret of Midichlorians and finally understood how to sense, isolate and train the Force in himself and others.
And it was on that day that Yoda said goodbye to his wizard father and elf-hobbit mother in the Shire and went forth into the galaxy to found the Jedi Council and train those in the use of the Force for protecting other planets than his own.