The Mann-Whitney U test is employed when comparing two independent groups on an ordinal outcome. It is also used when the assumptions of an independent samples or unpaired t-test are violated (normality, homogeneity of variance).
The Wilcoxon test is used when comparing ordinal outcomes at two different points in time or within-subjects. It is further used when the assumptions of a repeated measures t-test are violated (independence of observations, normality of difference scores).
A lesser known use for these two non-parametric tests is when significant main effects are found for non-parametric Kruskal-Wallis and Friedman's ANOVA tests. Much like with a parametric one-way ANOVA or repeated-measures ANOVA, if a significant main effect is found using non-parametric statistics, then a post hoc analysis must be undertaken to explain the significant main effect. Non-parametric statistics do not have Tukey, Scheffe, and Dunnett tests like parametric statistics!
When a significant main effect is found using a Kruskal-Wallis test, subsequent Mann-Whitney U tests must be employed in a post hoc fashion to explain where amongst the independent groups the actual differences exist.
The same holds true for Friedman's ANOVA. If a significant main effect is found, then Wilcoxon tests must be used in a post hoc fashion to explain where the significant changes occur amongst the observations or within-subjects.