European leaders have given Greece until Sunday to secure a deal and save its economy from collapsing.