Petroleum is a fossil fuel, which is formed by the decomposition of the dead remains of marine organisms that are trapped at high temperature and pressure conditions for millions of years inside the earth's surface. Thus, if we use petroleum higher than the requirement, it will get exhausted.
Whereas the sun is a continuous and unlimited source of energy. Sun is a renewable resource of energy which will not get exhausted.