There is no one answer to this that is correct for all systems that have both a prime minister and a president (or which have equivalent offices). The relative amounts of power are decided by the constitutions of the individual countries.
To see how this is true, let us look at the examples of France and Germany. France has a system in which the president has the most power. The people that everyone sees as the leaders of France are the presidents. Nicolas Sarkosy was the President of France. Right now Francois Hollande is the President. These men are known around the world. By contrast, the Prime Minister is a man named Jean-Marc Ayrault. He is not well-known and generally has less power than Hollande does. In Germany, however, the Prime Minister (called the Chancellor) is much more powerful than the President. Here, the Chancellor, Angela Merkel, is the person known as Germany’s leader. The President is named Joachim Gauck. His responsibilities are mainly ceremonial.
Thus, we can see that there is no one answer that fits all. Different countries have different systems.