caffeine=Show[ChemicalData["Caffeine","MoleculePlot"],PlotLabel->Style["Caffeine 3D Molecular Plot",20],LabelStyle->{GrayLevel[0.3],Bold}]

elements=ChemicalData["Caffeine","ElementTypes"];
elementLegend=SwatchLegend[ElementData[#,"IconColor"]&/@elements,elements,LegendMarkerSize->20,LabelStyle->{Bold,GrayLevel[0.3],18}]

Legended[caffeine,elementLegend]