The rules for Pokémon go's mega evolutions have changed over time. There doesn't seem to be any one place in the publisher, Niantic, states all the rules, mechanics and benefits for mega evolutions.
The question is really: what is the complete set of rules that governs how mega evolutions work in Pokémon go?
Best Answer
This is mostly repeat from This is the Dave's answer but with some extra detail and subheadings.
List of current Mega evolutions, their initial Mega evolution cost, and their types if they have changed from their base forms:
100:
200:
Mega evolution cost
The initial Mega evolution cost is either 200 or 100. After a Pokemon has previously Mega evolved, this cost is reduced by a factor of 5 (to 40 or 20, respectively) for that Pokemon only. For example a previously Mega Evolved Beedrill has a cost of 20, but all other Beedril still have a cost of 100 unless they have also Mega Evolved previously. This reduction remains even if the Pokemon is later traded.
Earning Mega energy
Mega energy can be collected for all Pokemon who can currently Mega evolve. The methods of collection are:
In-battle Mega evolution effects
All Mega Pokemon have altered Atk and Def which give overall boosted stats (currently all Pokemon have both Atk and Def stats improved, though when Mega Diancie gets released, it will likely lose Def). The Stamina stat will not change.
If a Mega evolved Pokemon is on the field in a raid or gym battle, all its and allied Pokemon's moves that share a type with the Mega evolved Pokemon will receive an attack boost until it leaves the field i.e. switches or faints.
Mega evolved Pokemon cannot be selected in teams in any PvP battles except for training against your team leader i.e. not against Team Rocket or other human players.
Outside-battle Mega evolution effects
Whilst you have an active Mega evolved Pokemon, all Pokemon caught of the same type as the Mega Pokémon reward +1 additional candy. +1 candy will also be rewarded when captuing a raid boss regardless of its type. A icon will appear on your profile on your friends' friend list, indicating that you have an active Mega evolution. If the Mega evolution Pokemon is your buddy, this Pokemon will be visible to other players in its Mega evolved form when they see your profile.
Mega evolution duration: 8 hours
Max Mega energy that can be stored per Pokemon: 2000