When Endless Horizons enters the battlefield, search your library for any number of Plains cards, exile them, then shuffle. At the beginning of your upkeep, you may put a card you own exiled with Endless Horizons into your hand.
If Endless Horizons leaves the battlefield, the remaining Plains cards stay exiled. If Endless Horizons returns to the battlefield, it's a new object with no relation to its previous existence. The previously exiled Plains cards will still stay exiled.
If a different player gains control of Endless Horizons, its ability will trigger at the beginning of that player's upkeep, but it won't do anything when it resolves.