You will be a really lucky lady if your man simply tells you that he wants commitment. However, not all of us are so fortunate. Sometimes, desperate measures are called for if you hope to get a ring on your finger.
Look for signs that he is really into you and wants to settle down. Does he want to meet your parents? How do you get on with his close friends? How do you interact in daily activities? Does he include you in his future plans? Can he put his needs aside for your sake?
If you are unsure, maybe you can give him some subtle hints about your intention. Let him know your feelings and see how he reacts.
In the end, if your boyfriend just can't bring himself to commit then perhaps it's time for you to reevaluate your relationship.
When he starts to talk about your future together as if it is a given. Like 'in the future we should live in the mountains' or 'once we are married we should do this'. If he starts to tell you he loves you that is a great sign.
According to sociological research (sorry, I can't find the source if this research as I read about it a few years ago) a man will know whether he wants to marry a woman after knowing her for only two weeks.
Ask him how he feels about marriage and if he runs, then he was never going to marry you in the first place. It may hurt but in the end, you will be happier as you will be free to find the right match before it's too late. No one should have to be in a relationship and not know how the other person feels because he/she is afraid to ask. That is not a healthy way to live.
I don't think there's one real way to really know. It works differently for different people. My dad knew and married my mother within the year that they met, but I know other couples who dated for 6 - 7 years then eventually split. Dad and mom separately had 5-year relationships prior to meeting each other.
It depends on what stage the couple is at too, what age, the duration and intensity of their previous relationships, and their family background or history too. (e.g. my friends with divorced parents have very different views on marriage and vice versa).