The energy required to break a molecule of H2O is equal to the energy released by producing it (burning hydrogen).
The efficiency of both processes is not absolute however. You can e.g. electrolyze water with an efficiency of let's say 20%. Then you burn hydrogen releasing the energy and capture it at say 60% efficiency. So you end up recovering just 12% of it.
edited: wording of the first sentence