When a dilute solution of sulfuric acid is electrolysed, gases are produced at both the anode and the cathode electrode.
The gas produced at the cathode burns with a 'pop' sound, when a sample is lit with a lighted splint. This shows that the gas is hydrogen.
2H+ +2e- → H2
The gas produced at the anode relights a glowing splint dipped into a sample of the gas. This shows that the gas is oxygen.
4OH- - 4e- → 2H2O + O2
The gases are produced when ions move towards the electrodes.