Quoth Jenny: There are exceptions (I believe) to belief being merely a habit. There are areas of study, such as Apologetics, where people have spent much time determining why they believe what they believe. Going back to first principles you might say, determining whether what they believe follows a logical train and whether it can be derailed. Of course, as in mathematics, at some point you have to have a first principle, something assumed to be true - possibly because it cannot be disproved - which must be accepted or assumed, because otherwise there is no possibility of any further thought. The trick is to know on what first principles you base your belief.
I should clarify that I didn't mention why people believe what they believe at all; I was just putting up a definition for what the word 'believe' ought to mean. Because idiomatically, when we believe something, we say 'X is so'; and if we don't really believe it, we say 'I believe X is so!'. I certainly did not intend to imply that there was anything mere about beliefs, just that words without actions can't be considered evidence for a belief...
You are quite right, the trick is knowing on what first principles to base your beliefs. Peirce goes on to elaborate four ways to figure out what to believe:
(1) Tenacity. Just keep on believing what you are believing, and don't let anybody change your mind.
(2) Authority. Trust what people you trust tell you.
(3) A Priori Argument. Agree that you are going to believe some things, and then believe all the logical implications of those things, like in mathematics or theology.
(4) Experiment. I have a prepared statement around here somewhere... here it is: When you are very young, you make observations of your environment. You manufacture a model of your environment based on these observations, and make predictions of the effect your actions will have on your environment. To the extent that you are capable, you act on your predictions and observe the effects. If they are not what you expected, you modify your model. Once you have made the inference that the large creatures around you are trying to communicate information which accords - as far as you can tell - tolerably well with the model you have already determined, you will increasingly abandon the method you have been employing thus far - known as science - for the method of authority.
Of course, in practice we all use all four of these ways all the time, and are right to do so: we cannot go around continually proving everything we need to develop effective habits by experiment. Did you do that course in third year on the History and Philosophy of Science, Jenny? This is all cribbed from there... :)
As far as specifically religious beliefs go, I would argue that in order to have any connection with reality our religious beliefs should ultimately be based on experiment- that is, on our own experience of God.