Here is a brief summary of Descartes' conslusions regarding the Self and the existence of God in Meditations on First Philosophy:
Descartes uses doubt to distill those things that could he could possibly be deceived about from those things that he must undeniably know. His rescurring analogy is in saying that perhaps there is a grand deceiver, someone who could be fabricating his experiences, and hence would make the reliance on his senses, his body, and the connection with reality fallible. What he declares as the only knowable fact is that he exists, but not as a person or body or even soul, but as some sort of thinking thing that recognizes existence. There is no way in which he could be aware of anything at all and not actually exist.
In doing this meditation on the mind, Descartes recognizes that he's been talking about what are his limits of understanding, but posits that he couldn't have conceived of the idea that there exists a limitless or infinite because he himself has limits. Descartes believes that a certain reality is contained within each idea, and that reality can't give you more ideas that it contains; in other words, we can conceive of weight and length and color because we have all these things in our reality, but we could never conceive of a completely new color.
This proposition is central to Descartes' argument of God, because he concludes that if he is only a limited thinking thing, then how could he conceive of all that he does, particularly of the concept of infinity? He himself is finite, so there couldn't be a way in which he dreams up infinity from scratch. What follows is that there must exist at least one more thing, that which is all encompassing, infinite, and can place those ideas into the mind which the mind couldn't create on it's own. This thing is God. God contains all things, knows all things, and is immortal. If nothing else exists, then according to Descartes, there must be at least him and God.