Under which conditions do gradient boosting machines outperform random forests? Can Friedman's gradient boosting machine achieve better performance than Breiman's Random Forest? If so, in which conditions or what kind of data set can make gbm better?
 A: As bayerj said it, there is no way to know a priori ! 
Random Forests are relatively easy to calibrate: default parameters of most implementations (R or Python, per example) achieve great results. 
On the other hand, GBMs are hard to tune (a too large number of tree leads to overfit, maximum depth is critical, the learning rate and the number of trees act together...) and longer to train (multithreaded implementations are scarce). A loosely performed tuning may lead to low performance. 
However, from my experience, if you spend enough time on GBMs, you are likely to achieve better performance than random forest.
Edit. Why do GBMs outperform Random Forests? Antoine's answer is much more rigorous, this is just an intuitive explanation. They have more critical parameters. Just like the random forests, you can calibrate the number of trees and $m$ the number of variables on which trees are grown. But you can also calibrate the learning rate and the maximum depth. As you observe more different models than you would do with a random forest, you are more likely to find something better.
A: The following provides an explanation as per why Boosting generally outperforms Random Forest in practice, but I would be very interested to know which other different factors may explain Boosting's edge over RF in specific settings.
Basically, within the $error=bias+variance$ framework, RF can only reduce error through reducing the variance (Hastie et al. 2009 p. 588). The bias is fixed and equal to the bias of a single tree in the forest (hence the need to grow very large trees, that have very low bias). 
On the other hand, Boosting reduces bias (by adding each new tree in the sequence so that what was missed by the preceding tree is captured), but also variance (by combining many models).
So, Boosting reduces error on both fronts, whereas RF can only reduce error through reducing variance. Of course, as I said, there might be other explanations for the better performance of Boosting observed in practice. For instance, page 591 of the aforementioned book, it is said that Boosting outperforms RF on the nested sphere problem because in that particular case the true decision boundary is additive. (?) They also report that Boosting does better than RF for the spam and the California housing data.
Another reference that found Boosting to outperform RF is Caruana and Niculescu-Mizil 2006. Unfortunately, they report the results but don't try to explain what causes them. They compared the two classifiers (and many more) on 11 binary classification problems for 8 different performance metrics. 
