That's a big question with a gazillion possible causes / answers.
People can fall out of love with each other.
Typically, it's because people grow in different ways, their emotional needs change, their desires change, etc. Eventually, they decide that they don't want the relationship anymore because it no longer benefits them emotionally.
Take a step back and assess how 'attractive' you have been to him. I'm not talking just looks, I'm talking about your attitude towards him. Are you mistrusting of him? Do you complain alot? Do you treat him like a child? Do you clam up and don't talk about what's going on inside you and then burst into flames when you have an arguement? Do you let him walk all over you (e.g. let him degrade you, call you names, control you in any way)? You really have to be honest about looking at yourself and how HE looks at you.
It took me a LONG time to figure men out and I'm happily re-married today.
Here's what I learned:
1. The more desperate you appear to him, the more he'll move away. Guys want to know that they are with a stable and strong woman. They don't want someone who appears too needy or insecure. Present yourself as a woman who values herself enough to just walk away when she's not wanted. If he has told you that he no longer loves you, then the message he is sending to you is crystal clear. WALK AWAY. Why would you want to convince someone to stay with you who doesn't want to deep down inside?
Having said that....for your NEXT relationship, #1 above applies in addition to these:
2. Guys can't read your mind. Don't sit silently waiting for him to mess up and then crucify him for messing up. Talk to him clearly and directly about what you want and need. Because men are 'task-oriented', if you give them direct instructions on how to give you what you need, they're thrilled to be informed and they will do what you ask.
3. Make sure that your future goals for the relationship are the same. This is a big one. Do you want to get married and he doesn't? Do you want kids and he doesn't? Does he want kids and you don't? It could also be that you both want kids but don't see the other person as the one to have kids with!
It's painful to hear someone you love tell you they don't love you anymore, but it's even more painful for you both to try to convince them to stay with you.
All the best ~