Chemistry - Electrolysis of Water
Solution 1:
Nobody has given an answer yet, so I'll give it a crack.
In electrolysis, as you probably know, there are two electrodes – the cathode (negative) and the anode (positive). We can deal with what happens at each separately, then tie them together.
At the cathode: $$\ce{2H2O + 2e- -> H2 + 2OH-}$$ You're interested in the mechanism of these reactions. We know that water exists in solution in an equilibrium: $$\ce{H2O + H2O <=> H3O+ + OH-}$$ At the cathode, electrons are supplied to the $\ce{H3O+}$ ions, reducing them: $$\ce{H3O+ + e- -> H2O + H* }$$ With many reactions happening at once, the $\ce{H*}$ radicals react together, forming $\ce{H2}$. By removing the $\ce{H3O+}$ ions, it shifts the equilibrium of water to the right, to oppose the change – removing $\ce{H3O+}$ ions and increasing the concentration of $\ce{H2O}$: $$\ce{H2O + H2O <=>> H3O+ + OH-}$$ Because the concentration of $\ce{OH-}$ ions doesn't change, the local solution around the cathode becomes basic – this can be done in a school lab. Add indicator. Electrolyse. Observe the color change near the cathode.
At the anode: $$\ce{2H2O -> O2 + 4H+ + 4e-}$$ Here I suspect the mechanism is a bit similar: $$\ce{H2O + H2O <=> H3O+ + OH-}$$ We take the $\ce{OH-}$ and oxidise it: $$\ce{OH- -> OH* + e-}$$ This results in a radical – the hydroyxl radical – being formed. The steps from here, to get to water being formed are probably quite complicated as a mechanism.
Solution 2:
Swedish Architect's answers already proposed quite thoughtful insight into this question. The only thing I was missing there were some solid research results on the matter to backup these reasonable claims. In course of my own research I came across a website, that provided me with a quite recent density functional study of the subject: "Electrolysis of water on (oxidized) metal surfaces" by J. Rossmeisl, , A. Logadottir and J.K. Nørskov. Chemical Physics 2005, 319 (1–3), 178–184.
I will here try to outline their reaction mechanism, which they used for their quantum chemical treatment. In their work they considered platinum and gold surfaces as electrode material. I will not go into detail in analysing their results, since this exceeds the scope of this question.
Water splitting follows the general net reaction process of $$\ce{H2O -> 1/2O2 + H2}.$$
At the cathode the following mechanism is proposed in acidic media: \begin{align}\ce{ 2H+ + 2e- &-> H^{$*$} + H+ + e- \\ &-> H2 }\end{align} The asterisk superscript denotes, that the formed Hydrogen $\ce{H}^*$ is chemically adsorbed to the active site at the metal surface. They continue that hydrogen is only weakly bound to the metal surface and therefore the hydrogen evolution is much faster than the rate of oxygen production. Hence they focus on the reaction on the anode.
The oxygen evolution takes place at the anode and follows a more complicated mechanism. Again the asterisk denotes that the molecule is chemically adsorbed the the metal surface. \begin{align}\ce{ 2H2O &-> HO^{$*$} + H2O + H+ + e- \\ &-> O^{$*$} + H2O + 2H+ + 2e- \\ &-> HOO^{$*$} + 3H+ + 3e- \\ &-> O2 + 4H+ + 4e- }\end{align} The key step in this reaction series is the formation of the active peroxide intermediate as they found out. It is therefore also the rate determining step. The doubly bonded $\ce{O}^*$ and singly bonded $\ce{HO}^*$ species are relatively strongly bound to the surface. They also found out, that a coverage of up to $2/3$ of the surface with a monolayer of oxygen is necessary in order for the peroxyl species to become more easier than $\ce{O}^*$ and $\ce{HO}^*$.
In an alkaline electrolyte they propose the following mechanism, which only slightly deviates from the above. The intermediate species are the same, that's why they did not need to treat them separately. On the cathode they just summarised as $$\ce{2H2O + 2e- -> 2{}^{-}OH + H2}$$ as the mechanism is bound to be the same. On the anode on the other hand the following steps should be observed: \begin{align}\ce{ 4{}^{-}OH &-> {}^{$*$}OH + 3{}^{-}OH + e- \\ &-> {}^{$*$}O + H2O + 2 {}^{-}OH + 2e- \\ &-> {}^{$*$}OOH + H2O + {}^{-}OH + 3e- \\ &-> O2 + 2H2O + 4e- \\ }\end{align}
Additional note and criticism
Water is only liquid at room temperature due to a strong network of hydrogen bonds. As the included monolayers of water molecules it is sufficient to say that the system is treated extensively. However, what they failed to describe in their model is the conduction of electricity through the electrolyte. The reason why electric current passes quickly through an aqueous medium can be benefitted to the Grotthuss mechanism. This being said, I would think that the treatment of more than one monolayer should be considered, however I understand that this might not be possible due to technical limitations.
Another detailed description of the mechanism based on cyclovoltametrie can be found in Catalysis Today 2013 202, 105–113: "Water dissociation on well-defined platinum surfaces: The electrochemical perspective" by Maria J.T.C. van der Niet, Nuria Garcia-Araez, Javier Hernández, Juan M. Feliu and Marc T.M. Koper.
Solution 3:
I'm adding another answer, representative of another mechanism, which I think is probably more likely than the one I proposed. It follows a similar line to the previous mechanism, but involves the adsorption of water molecules onto the cathode and anode. I will consider the reactions at the anode and the cathode separately, like in my previous mechanism.
Water is a polar molecule - the oxygen atom is more electronegative (the AOs on oxygen are lower in energy than the 1s orbital on the hydrogens, which contribute to the bonding MOs) than the hydrogen atoms, and thus the molecular orbitals will have a higher electron density on the oxygen than on the hydrogen. This gives the oxygen a small negative charge, and each hydrogen a small positive charge - not a full, ionic charge.
Because of this charge liquid water has a network of hydrogen bonding, as the positively charged hydrogen attracts a lone pair from another oxygen, thus producing a hydrogen bond - an attraction between the water molecules.
At the cathode (-ve electrode) the water molecules align themselves with this negative charge on the metal cathode. The hydronium ions are reduced by the negative metal electrode. Thus we have $$\ce{H3O+--M + e- -> H2O + H-M}$$ This explains the production of hydroxide ions - turning the solution basic at the cathode. The hydrogen is bound to the metal , using a d-orbital. (If you're interested look up hydrogen adsorption onto metal surfaces). These hydrogen atoms are able to diffuse across the metal surface, in two dimensions, kind of like skating across an ice rink - you can't jump, but you can skate easily across it (unless you're really good!). These hydrogen atoms can then react together, forming hydrogen gas. Consider the equilibrium of water: $$\ce{H2O + H2O <=> H3O+ + OH-}$$ Decreasing the concentration of $\ce{H3O+}$ means there is proportionally more $\ce{OH-}$ than $\ce{H3O+}$, which results in the solution near the cathode becoming basic. The hydrogen bound to the metal is not particularly stable - therefore a pair of hydrogen atoms can react, becoming $\ce{H2}$, as the hydrogens are able to diffuse across the surface of the metal.
At the anode (+ve), we know that $\ce{O2}$ is produced. Again the water molecules align themselves to the charge - the negative oxygen is attracted to the positive metallic anode. The positive metal will interact with the electrons involved in bonding in water. We can envisage this as the positive metal "pulling" electron density from the oxygen. This in turn pulls electron density from the two bonds, joining the oxygen and the two hydrogen atoms. This is the inductive effect - where a positive charge is transmitted through atoms - the electron withdrawing effect. This weakens the $\ce{H-O}$ bonds. The hydrogen atoms are then solvated, to form the hydronium ion, $\ce{H3O+}$. Reaction: $$\ce{2H2O + H2O -> 2H3O+ + O + 4e-}$$ The 4 electrons are then used to reduce the hydronium ion at the cathode - remember this is a circuit. The oxygen remains bound to the metal, and then reacts with another oxygen to form $\ce{O2}$.
I think this mechanism is more likely than the other I proposed. I am not sure about how the oxygen is bonded to the metal - in a normal coordination complex the metal donates electrons, forming a coordinate/dative bond, instead of oxygen donating a lone pair to form a dative bond. However, in this case the metal is positively charged, with an active potential difference - energy is being put into the system. I would be interested for more experienced/knowledgable people to improve this mechanism and point out reading on this.
Solution 4:
I would add to the first answer that the formation of the hydroxyl radical can also form a small amount $\ce{H2O2}$ via $\ce{OH⋅ + OH⋅ <=> H2O2}$.
The unmatched hydrogen radicals could react forming $\ce{H2}$ and leave the solution. The newly form $\ce{H2O2}$ could attack, for example, a copper electrode contributing to anodic (or cathodic) corrosion. Galvanic cells frequently have many non-electrochemical based side reactions occurring as well.
Solution 5:
In pure water at the negatively charged cathode, a reduction reaction takes place, with electrons ($\ce{e^{−}}$) from the cathode being given to hydrogen cations to form hydrogen gas (the half reaction balanced with acid):
Reduction at cathode: $\ce{2 H+(aq) + 2e^{−} -> H2(g)}$ At the positively charged anode, an oxidation reaction occurs, generating oxygen gas and giving electrons to the anode to complete the circuit:
Oxidation at anode: $\ce{2 H2O(l) -> O2(g) + 4 H+(aq) + 4e^{−}}$ The same half reactions can also be balanced with base as listed below. Not all half reactions must be balanced with acid or base. Many do, like the oxidation or reduction of water listed here. To add half reactions they must both be balanced with either acid or base.
Cathode (reduction): $\ce{2 H2O(l) + 2e^{−} -> H2(g) + 2 {}^{-}OH(aq)}$ Anode (oxidation): $\ce{4 {}^{-}OH (aq) -> O2(g) + 2 H2O(l) + 4 e^{-}}$ Combining either half reaction pair yields the same overall decomposition of water into oxygen and hydrogen:
Overall reaction: $\ce{2 H2O(l) -> 2 H2(g) + O2(g)}$
See also: http://en.wikipedia.org/wiki/Electrolysis_of_water