The idea of band gap is considered when we are interested in semiconductors (SC) and some times insulators. The band gap refers to the energy difference between valence band and conduction band which is measured in eV. I thing there is no such difference but the way of interpretation energy band gap. The term 'optical band gap' generally is used when the interaction of electromagnetic radiations with SCs and their response to the radiation is noticed and electronic term band gap is used when the allowed transition of electrons from valence band to conduction band are considered. However the key concept is same.
you can this information in any Solid State Physics book.. For detailed study on specific material you can easily approach to scholars articles on Google.
You know that, each system prefer to be in its ground state (G.S) and electrons fill energy levels from down to up. The highest occupied level is called HOMO and the lower unoccupied level is called LUMO. The difference between HOMO and LUMO is called Kohn-Sham band gap (Eg) which can be calculated using a Quantum Chemistry Computational Package. e.g., Using #B3LYP 3-21G Command of Gaussian 2003 Code (G03) you can find HOMO, LUMO and Eg. But if you find first, second and third excited states (E.S) which amy be singlet or triplet, the transition between these excited states is different from transition between HOMO and LUMO. Using TDDFT 3-21G Command of G03, you can find the excited states and the energy of photons which is necessary for exciting an electron from G.S to E.Ss and their oscilation strength (it conceptually is synonym with probability transition). It shows optical Eg. It differs from the difference between HOMO and LUMO.
The methods of measurements are different, giving different results for optical and band gap. the optical gap is obtained from UV-vis spectrum and the formation of electron-hole semi-particle causes a smaller value in comparison to the bond gap especially in the p-conjugated systems.
I completely agree with Mr Ali Ahmadi Peyghan in this matter.
On top of that consider that in optical matter the famous equation of E=hu(freq) is used to measure the H-L gap. Electronic H-L is based on Ervin schrodinger' eq.
In some cases they could be the same. Indeed, optical gap depends on the polarization of pertubative electric field and also space group of the crystal (or molecule). But, electronic band gap is intrinsic and defined as energy difference between V and C bands.