I recently heard the very sensible suggestion that how close you go to failure should depend (in part) on what lift you're doing and how safely you can bail.
E.g., if you're doing a barbell bench press and you don't have a spotter, you probably want to stay a good rep or two away from failure to make sure that after your last rep, you still have the strength to rack the bar safely.
Whereas if you're doing a deadlift, you can push closer to your limit, because if you fail, the bar just drops to the floor.
Adding to this:
E.g., if you're doing a barbell bench press and you don't have a spotter, you probably want to stay a good rep or two away from failure to make sure that after your last rep, you still have the strength to rack the bar safely.
Whereas if you're doing a deadlift, you can push closer to your limit, because if you fail, the bar just drops to the floor.