If a pacemaker fails will the heart continue to function until I can make it to hospital?

Depends. As a rule complete pacemaker failure is exceedingly rare especially if regular follow-up is maintained. The risk of a complete lead or battery failure would depend on how dependent you are on the pacemaker. Some people have no escape beating and then the consequences are obviously more severe, potentially fatal.
It depends. Complete sudden failure of pacemakers without warning signs is extremely rare. If your heart needs the pacemaker all the time, you may pass out or feel very weak should the pacemaker fail suddenly. If so, call 911 as they have things to temporarize problems until they get you to hospital. Regular monitoring of pacemakers every 3 months usually prevents these issues.