Can I plug my E27 bulb directly into my wall socket
Compact Fluorescent Lightbulbs

So long as the lightbulb is rated for 240V (and not 110V or 120V) it will work when connected as you suggest. In countries with 240V household outlets, retailers will normally supply lightbulbs rated for 240V. Check the packaging and the lightbulb itself - the voltage will be marked on them.

There is a manufacturer's datasheet for the part with EAN code 8710163224138. It says "• Voltage: 220-240 V" - so this is OK.

A home-made light fitting of this sort may not meet your local electrical safety code (i.e. law). Normally there has to be an enclosure designed for the purpose. The enclosure provides mechanical protection to the lightbulb (especially any glass parts) and provides some protection against people inadvertently touching parts that carry live current or which might do so in a fault condition.

You also need to pay attention to earthing any metal parts that are accessible.

In particular, compact-fluorescent lightbulbs of that sort are relatively delicate and, if broken, will leak mercury - which is poisonous. It is prudent to provide some protection in case the luminaire is accidentally knocked over or bumped into.

Other lightbulbs

Some lightbulbs are designed for low voltage. For example some desk-lamps use halogen bulbs that require 12V DC. These desk-lamps are supplied with a suitable transformer. These lightbulbs should never be directly connected to 240V AC.

These type of lightbulbs will never be provided in a E27 fitting. In general, you can be sure that any commercial lightbulb with an E27 fitting supplied in a well-regulated country by a reputable vendor is suitable for your local household electrical supply (e.g. 240V AC)

Other appliances

As you note, phone "chargers" and similar items contain a transformer that typically convert the household electrical supply (e.g. 240V AC) to a voltage suitable for the small appliance (e.g. 5V DC).