I'm developing on my laptop which is constantly connected to the Internet while I'm working. I installed Apache2 with Ubuntu default settings, MySQL and PHP. How safe is it for me to develop when I'm connected to the Internet? Couldn't sb get access to my system somehow?
The short answer is: Probably yes, someone could access your server.
Apache and MySQL can both be configured to listen only on localhost, which would make it impossible for someone out on the internet to connect to either; if you have not already configured them to do this (Apache is configured by default to listen on all available IPs, including your public IP; MySQL depends on the particular distribution, but usually defaults to just localhost), I very strongly suggest you do so (it's the Listen directive in Apache, and the bind (IIRC) directive for MySQL).
Additionally, you should run a firewall that (at the least) only accepts incoming connections you want to accept -- which, by default, should usually be none whatsoever. Just let localhost access your local Apache and MySQL ports, and no one else, and then even if your configuration changes on those servers the firewall will still be protecting you.
With these two steps done, you can safely run these servers while developing locally. For an extra layer, put a physical firewall/NAT between your machine and the big bad internet, and that would be one more thing that would have to allow incoming connections before your development environment can be compromised.