The difference is in the context.
A conjunction joins a dependent clause to a sentences. A preposition joins a prepositional phrase to a sentence.
The families got separated after the war.
Here, The families got separated is a sentence and the war is a prepositional phrase being joined to it. Hence, the word after is a preposition in this case.We went to the bar after we won the game.
In this case, we went to the bar is the main sentence and we won the game is a dependent clause. Hence, the word after is a conjunction here.