Bad news on this one is that, like most questions about Shakespeare's biography, we don't have any hard and fast answers. All we have are the very, very basics of his life story. So we do know that he was born in Stratford in 1564, and we know that he married Anne Hathaway, when he was only 18 (the marriage license we have is dated 27 November, 1582). After that, we're not quite sure at what point he left for London.
But we do know he arrives in London somewhere around 1585-1592 (the intervening gap is often called 'The Lost Years', precisely because we don't know what happened!) and quickly establishes himself as a writer with the Lord Chamberlain's Men (who, later, under James I, become the King's Men).He didn't, unfortunately, leave us a biography, or detailed biographical information to go on.We only know from dating his plays the approximate sequence of his writing lifetime.
We think, though there's no hard evidence, that Shakespeare returned to Stratford toward the end of his life. No plays are attributed to him after 1612, and although there is some evidence of him spending time in London, we presume he was living in Stratford with his wife and children. He died in 1616.
Why did he retire? Did he even retire? We just don't know. Yet, perhaps, if you have a look at the epilogue to 'The Tempest', in which Prospero bids farewell to his art, you might be able to suggest (though, again, without any actual evidence) that this play represents Shakespeare's own farewell to the stage.
Hope it helps!