Pokémon just recently announced on their website that it is now possible to get Mega Mewtwo X and Mega Mewtwo Y in Pokémon Sun and Pokémon Moon. However, it’s not as simple as just catching a Mewtwo holding a Mega Stone; the process is kind of complicated, so bear with me.
First of all, Mewtwo is not available to catch in Pokémon Sun or Moon, so you’ll have to transfer a Mewtwo from another game (such as Pokémon X or Y, where Mewtwo can be caught in the wild) into Pokémon Bank using the Poké Transporter. Then transfer Mewtwo from Pokémon Bank to Sun or Moon. Held items cannot make this trip, so if your Mewtwo is currently holding a Mega Stone (or any other item), it will be lost by the time it gets to your Sun or Moon game. This is why Mega Mewtwos have been unattainable in Sun and Moon thus far.
Now that you have Mewtwo, getting the Mega Stones is a whole new ordeal. When you start the game, select “Mystery Gift” instead of “Continue.” Press “Receive Gift,” then “Get with Code/Password,” then “Yes” and “Yes” again. Now you will have to enter the code. The code is M2DESCENT. Once you enter the code, you should receive a Mewtwonite X and Mewtwonite Y. Now continue your game and speak to the deliveryman in any Pokémon Center and he’ll give you the Mega Stones.
Usually events like this that involve legendary Pokémon are set to happen for a certain time, making the legendary Pokémon have limited availability. However, there has yet to be a timeframe connected to this event. It’s probably a good idea to do it as soon as possible anyway, just in case.