Hi.
It does sound impossible, doesn't it: Getting emotionally comfortable with someone while knowing you could be hurt badly if the relationship ends. But somehow people keep falling in love...
It's true that you might be hurt if you and your boyfriend break up at some point. And acknowledging that possibility, as you seem to be doing, is probably a good first step toward finding a way to feel better about it.
The challenge, of course, is not letting your fears distract you so much that you can't be happy with your boyfriend!
I suggest trying not to focus too much on the future while your relationship is going strong--living "in the present" as much as you can--but at the same time accepting that one day it might end. Some relationships do last a lifetime, but that's pretty rare because people change so much, and so quickly when they're young. And breaking up is not always such a bad thing; being single or dating someone else usually opens new doors.
What also seems to help people through breakups is having a strong sense of themselves as individuals while they're in the relationship--not getting swallowed up by it and having independent interests and friends.
Along those lines, you might want to check out some of these resources.