To do this on Android you have to select your current network, long press it and choose 'modify'. There you can enter the IP address of your Mac and the default port number 8888. From there it should just work!
For iPhone the task is much the same. Go to the Settings app, tap Wi-Fi, find the network you are connected to and then tap the blue disclosure arrow to configure the network. Scroll down to the HTTP Proxy setting, tap Manual. Enter the IP address of your computer running Charles in the Server field, and the port Charles is running on in the Port field (usually 8888). Leave Authentication set to Off.