In an implantable heart stimulator and a method for operation thereof, stimulation pulses are delivered to a heart. The amplitude of the delivered stimulation pulses can be selectively set. For setting the amplitude, threshold searches are performed at selected time intervals. Each threshold search determines a threshold value required for achieving capture. The amplitudes of the respective stimulation pulses are set to a value that exceeds the determined threshold value by a safety margin. The safety margin is selected as a function of the selected time intervals.