Ultracold bosonic atoms in optical lattices self-organize into a variety of structural and quantum phases when placed into a single-mode cavity and pumped by a laser. Cavity optomechanical effects induce an atom density modulation at the cavity-mode wave length that competes with the optical lattice arrangement. Simultaneously short-range interactions via particle hopping promote superfluid order, such that a variety of structural and quantum coherent phases can occur. We analyze the emerging phase diagram in two dimensions by means of an extended Bose-Hubbard model using a local mean field approach combined with a superfluid cluster analysis. For commensurate ratios of the cavity and external lattice wave lengths the Mott insulator-superfluid transition is modified by the appearance of charge density wave and supersolid phases, at which the atomic density supports the buildup of a cavity field. For incommensurate ratios, the optomechanical forces induce the formation of Bose-glass and superglass phases, namely non-superfluid and superfluid phases, respectively, displaying quasi-periodic density modulations, which in addition can exhibit structural and superfluid stripe formation. The onset of such structures is constrained by the onsite interaction and is favourable at fractional densities. Experimental observables are identified and discussed.