A long time
helps ensure you will have as close to a normal heart rhythm as possible.
The pacemaker box (known as a generator) and the wires that connect the generator to the heart do require replacement periodically. There is some risk involved with these procedures, but it is not high. Also some patients who are paced can develop a weakened heart muscle. You doctor can watch for this.