I don't think there is a universal method to determine whether you should resign. Many factors could affect your decision
First of all, if you are just playing a practice match for fun, you might want to resign earlier (assuming you have a lost position) instead of fighting till the bitter end. On the other hand, for a beginner player you can learn how to convert an advantage if you do not resign.
In a tournament however the situation is different and even if you have a theoretically lost position you might not want to resign immediately for any of the following reasons:
- if your opponent is short on time
- if the position is sufficiently rich (complicated with e.g. many pieces on the board); giving you swindle chances and your opponent options to screw up
- if you think that your opponent is too weak to reliably convert his advantage in a normal position (playing a beginner you might still want to continue with a queen down or so, while playing a GM in most cases they will squeeze out a win if you are down say two pawns or so)
- if you are playing in a team and your loss would help your opponents to adapt their strategy: for example, knowing that they have a point for sure on your board they could go for draws on other boards in some situations
Whatever you do avoid playing out until the end, completely lost/easily won positions against reasonably strong opponents.