Welcome to Smogon! Take a moment to read the Introduction to Smogon for a run-down on everything Smogon, and make sure you take some time to read the global rules.
After you Mega-Evolve, you stay in it for the rest of the battle. That means you won't take damage the first time you send it out, but once you Mega, each time it gets sent out damage will be applied.
So, Gamefreak... We're playing this game, huh. *puts on hat*
Now to wait for them to release Mega evolution details once a month... How long before we get to know them all?