An aqueous solution contains water as well as the dissolved ionic compound. Water molecules break down a little, giving hydrogen ions and hydroxide ions, so there are two possible ions to be discharged at each electrode. Which one is discharged depends on reactivity.
At the cathode, hydrogen is produced if the metal in the compound is more reactive than hydrogen. If the metal is less reactive than hydrogen, the metal itself is produced. At the anode, oxygen is produced from hydroxide ions unless the solution contains halide ions, such as chloride, bromide or iodide. If it does, the halogen is produced instead.
For example, sodium chloride solution gives hydrogen at the cathode and chlorine at the anode. Copper sulfate solution gives copper at the cathode and oxygen at the anode, because copper is less reactive than hydrogen and sulfate is not a halide.
In required practical 9 you electrolyse solutions using inert electrodes such as graphite, and test the products. Hydrogen makes a squeaky pop with a lit splint, oxygen relights a glowing splint, and chlorine bleaches damp litmus paper. You can form a hypothesis from the reactivity rules and then test it.