Here's a quick summary:
Link stays after defeating Ganondorf: adult timeline, Ganon will eventually break his seal, and WW comes
Link goes back in time: After telling Zelda and King Hyrule what Ganondorf will do, he goes to look for Navi, where MM comes.