Why do you still want a relationship with a guy you just started dating considering that you are on the way out of town for an extended period of time? And do you expect him to be okay with that?
Look, you're heading out on a new life adventure, embrace it. Don't get caught up holding on to what might be at home when you have no clue what is going to happen once you leave. And further, why would you try to maintain a long distance relationship anyway, given that you two just met. Long distance relationships are a pain in the arse for anybody. They're even more difficult early on because they rely on quality time and the ability to get to know one another. You can't do that from hundreds of miles away. If anything, you and this fellow can remain friends and perhaps if you ever return to where he is you may pursue something. But with it being such a fledgling relationship, I'd suggest that you cut your losses, enjoy his company for now and then move on for a while.
The sooner you tell him the better, I'll tell you that. Since you know when you're leaving and he doesn't, he may be investing all of himself into you because he thinks the relationship is going somewhere. It's unfair for him not to know. He has a right to the information that could determine what he wants to do. Who knows, perhaps he'll want to pursue a long distance relationship with you. Who knows? But you need to tell him soon that, "hey, I'm in the military and I'm leaving soon, but I like you and want to be with you."
Let him make up his mind about that.
It was written.