The answer to this depends on what your expectations are for the United Nations.
Some people expected the UN to be able to prevent war. They expected that the UN would prevent war through the threat of collective security. Any country considering attacking another would refrain from doing so because it would fear that many other countries, under the auspices of the UN, would retaliate for its attack. If we go by this criterion, the UN has been a failure. It has failed to prevent a number of wars since WWII, most notably the Vietnam War.
However, others simply expected the UN to move the world towards being a more peaceful place. In this view, the UN would provide a venue in which countries could get together, talk to one another, and do things like working together to solve common problems. As they did this, they would build more and more ties with one another and would therefore be less likely to go to war with one another. From this point of view, it is at least possible to argue that the UN was successful. The years since 1945 have certainly been more peaceful than many 60+ year periods in the past. This is particularly true of the last 20 years or so. This can arguably be attributed to the ties that have been built up between countries as a result of the UN's existence.