This is in Spanish a subjective tense known as the Pretérito Pluscuamperfecto del Subjuntivo because it is not objective, but used in a hypothetical situation.
This can be used with the Past Perfect Subjetive or with the Conditional Perfect in English.
If I were you, I would have gone before.
Si yo fuera tu, yo me hubiera ido antes. or also..
Si fuera tu, ya me hubiera ido. (abbr)
Person 1: I've been waiting for her for 3 hours.
Person 2: For three hours? You are crazy man! You should have gone before.
Persona 1: He estado esperando por ella por 3 horas.
Persona 2: ¿Por tres horas? ¡Estás loco! Te hubieras ido antes.
That's a hypothetical situation because, in fact, the first person stayed there for 3 hours, while the second person is giving advice based on something that has already happened in the past.