1. It won't work at all if you try to connect it directly to the PSU. You need an inverter to convert it to 220v AC to power the PSU, or replace the PSU with one that runs on DC voltage. I'm going to assume that you'll be using a 12v battery.

2. How long it will last depends on a lot of factors:
-- battery capacity (in ampere-hours)

-- actual current draw of the PC (it will draw much more current when fully loaded compared to idle)

-- conversion efficiency of the inverter and PSU (if you're using an inverter), or the DC PSU. The second option is generally more efficient as only one stage of power conversion (DC-DC) is done.

Using an inverter is less efficient because there are power losses on each stage (DC--> AC then AC --> DC) of conversion. Note that this is how an Uninterruptible Power Supply (UPS) works, so it's possible to make a "guesstimate" of battery runtime by comparing your battery capacity to that of what's inside a particular UPS.