On a mac, the ethernet port is called en0 and the wifi port en1.
You can verify this by going to System Preferences -> Network then, selecting Ethernet, clicking Advanced then looking at the Ethernet tab - this will tell you the mac address. Do the same but select Airport to get the mac address of the wifi port.
Then in a terminal type ifconfig to get a list of network interfaces, that will show you the interface name for each interface (en0, en1, etc), and a load of other information, including the mac address which is labelled 'ether'.
Once you know what the names are of the interfaces, you can set up cron jobs to disable them as described by Amardeep. - use en0 instead of eth0, and repeat for the wifi port.