“Like dissolves like” is the concept for the solubility. That means polar molecules dissolve in polar solvents and non-polar molecules dissolve in non-polar solvents.
If a molecule forms H-bond with water then that molecule will also be soluble in water because there exists H-bonds in water as well(similar intermolecular force).
Glucose has 5−OH groups and sucrose has 8−OH groups and both can form H-bond with water molecules.
This is the reason why glucose and sucrose are soluble in water.
But in case of benzene and cyclohexane both are non-polar in nature and they cannot form H-bond with water. So, they are insoluble in water.