Excepting for anything in the quince family (pears, quince, etc.) which are picked green the moment the stem clicks free when you lift the fruit to a 45-65 degree angle, tree ripened is probably best.
The ripening process is started by ethylene gas, the smell given off by ripe bananas or apples. Industry fruit is often picked green and forced with ethylene gas produced from petroleum and the flavor difference between forced and natural is quite noticeable (not because of a pure gas produced from petroleum). Natural ripens from inside to out, forced from outside to in with incomplete starch to sugar conversion.
So, about mangoes, they're best if tree ripened, but birds are an issue so what you get in the store often is picked early. You can pick them just as they start to turn and start to soften. You can leave them sit at room temperature to ripen out or put them in a plastic bag with a ripening banana to move the process along. Keep the banana out of contact with the mangoes.