The mains is constantly charging the battery and the battery is what is powering your system, if the mains fails the battery continues to power your system. Depending on the current being drawn by your system and the size of the battery, it should last anything between 6 and 12 hours. Professional installers will use a multimeter to find out what current is being drawn, and calculate what size battery is required to provide a minimum of 12 hours standby.