I'd like to know how much the number changes depending on whether it's done using hardware or just in software. I'm curious how long you'd have to leave a computer mining bitcoins for it to pay for itself
It really depends on how much you're willing to spend.
Let's talk about the very smallest investment you could make for mining bitcoins: a Raspberry Pi. It can do 200,000 hashes per second, which might sound like a lot, but actually it's about 0.000001% of the total network hashrate.
Power: 3.75 W
Hashrate: 0.2 MHash/s
(Note: this doesn't mean a RPi is useless for mining. You can use it as a host for your ASIC/FPGA miners.)
Okay, CPU mining is bad, but what if we use GPU's?
Let's say we use a $162 graphics card, the 5830 from AMD. Let's throw in another $187 for case/motherboard/power supply. (Based off of this list I just threw together.)
Power: 175 W
Hashrate: 302 Mhash/s
Okay, let's get something specifically designed for bitcoin mining - the ModMiner Quad. It costs $1070, but it needs a host, so let's use a raspberry pi for that.
Power: 43 W
Hashrate: 800 Mhash/s
Okay, let's say that you have stupid amounts of money to use on mining hardware. Let's say that you can get a Bitforce Mini-Rig. (They are not being sold yet.) In fact, let's say that you can get 10 of them. This gives you 40% of the bitcoin hashrate.
Power: 15,000 W
Hashrate: 15,000,000 Mhash/s
The lesson here is that you can spend any amount of money on bitcoin mining.