If you're lucky forever considering it plugs into the wall.
If you run your LED's in 3 series which would be best for 12 volts, you'll need 90 LED's or 30 strings of 3 with a limit resistor for each string. Use the worse case scenario of 3.4 volts per LED and figure 20ma's of current per string which is a good safe current for those LED's you'll need a dropping resistor of
3.4 * 3 = 10.2 volts dropped in the LED's
12 volt supply, that leave 1.8 volts left to drop, at 20ma's that's a 90ohm resistor. I don't think you can find 90 ohm resistors although if you can use them, I'd be safe and go with the next highest which is 100ohms.
Worse case that uses 600ma's at 12 volts. Or about 8 watts. Any UPS you pick will have a watt rating and should have a chart which shows you how long it will run at a certain percentage of it's maximum rating. The problem with using a battery directly is that you have to regulate it somehow. A car battery will go from around 14 volts fully charged to around 10 volts close to flat, which is not exactly good for average brightness over the full discharge range, so your idea of using a UPS is not that bad idea, the main problem being they almost always beep really loud when power is lost =)