The boiler heats the water to a set temperature. If the water were to stay at that temperature, the boiler would stay off. The boiler fires up when the water cools down. The more radiators you have on, the faster the water cools and the more time the boiler has to stay on to keep it up to temperature.
It's actually more complicated than that. The amount of energy that the boiler has to put into the system is the amount actually lost by the building. If you had perfect insulation, the heating would warm the house up to the required temperature and never come on again. However, heat is lost through the roof, walls and floor. The greater the temperature difference between inside and outside the house, the more energy escapes. Having all the house hot means that more energy is lost through leakage to the outside world. Having only part of the house hot means less energy is lost and you use less.
You mention electricity. Do you have an electric powered boiler? If the boiler works with oil or gas, electricity is only used for the pump and ignition. The longer the pump is running, the more electricity you use, but that depends on the use cycle of the boiler and pump.