I want my phone (running Android 2.3.5) to only connect to the Internet via Wi-Fi.
How can I disable all non-Wi-Fi connections, such as 3G or similar?
This functionality is built into android so there's no need for an external tool/application.
In settings:
Wireless and networks -> Mobile Networks -> Data Enabled
Disable this and you're all set.
You can go on the configurations and disable the usage of mobile networks manually. If you want a more handy tool (i.e. not need to open menus), looks like this app can do it: APN Switch
APN-Switch is a simple widget that allows you to quickly enable (or disable) your data connection (3G/EDGE/GPRS) with a single click.
What I've done before is to turn on Airplane Mode, then turn on Wifi. Works like a charm on my Galaxy S.