There and Back Again
The West Marches gameplay style gives us a structural conceit: Start in Town, End in Town. It exists to satisfy the format's real-world need for players to be available for mix-and-match adventure groups while also maintaining a sense of verisimilitude: characters can't magically pop back into town without actually doing the work to get there. In other words, the format asks players to get back to town at the end of the session so that when another player asks "hey, can your thief character come with us on Thursday's adventure?" they can accept without having to hand wave how their character got back to town.
Of course in practice this can be tricky to facilitate. It takes work from both sides of the GM screen. And in my experience many players don't really want to do that work: with no particular incentive to go home again it can feel like an artificial restriction, especially when coming from a more traditional campaign format.
Here are some ideas (some carrot, some stick) to help encourage our players to stick to the format and get their asses back to town by bedtime.
Real World Solutions
Explain Why
Just talking to your players is the first and most important method solving this issue. Normally if they understand the reasons for the rule, they'll agree to it. Do this before anything else.
Set a Timer
It's easy for everyone to lose track of time while playing. If you know you have to stop playing at 11pm, set an alarm for 10:30. When it goes off remind the group that they have 30 minutes to get back to town, so consider the logistics of how to get home again.
Fallback Procedure
Come up with a procedure for last-minute return trip resolution. If your party leaves it too late and you don't have time to use your regular travel procedures, come up with a fallback. It could be punishing if you are trying to discourage your players from relying on it, but it doesn't have to be. Maybe you can use this as the default way to return home!
The easiest solution is a single roll. Maybe they make it home either way, but the roll determines if they lose their treasure. Maybe the roll determines if they survive at all! Maybe the procedure is more complex, but remember that it should be simple enough to rely on in a time crunch, and it should be tonally appropriate for the game you're running.
Character Progression in Town
It doesn't matter how much XP you accrue, you can only level up back in town. Even worse, any XP past that which would take you to the next level is wasted!
Resource Drain
Every session past the first one you stay outside of town drains away a resource. Maybe it's XP. Maybe it's gold. Maybe it's HP, or worse yet: your max HP. You can justify it in the fiction however you like: maybe the players need to pay homage to the goddess statue in town, and failing to do so risks displeasing her. Maybe the air in the valley is poison, so they must return home to cleanse their lungs. Maybe there is a merchant in town to whom you sell treasure and his schedule is very particular: he'll give you good value on goods sold to him before his caravans leave, but he can't get the same returns once they've left so he won't buy at full price.
Or you could forego the Watsonian explanation for the Doylian and leave it at that: you get punished if you stay out too long.
In-Fiction Solutions
The Slingshot
The adventuring zone exists in a big magical bubble of some kind. Characters enter it through a kind of Stargate portal, and we can imagine they are encased in a sort of ethereal film. Once inside they have a limited amount of time before their bubble bursts and they find themselves flung out of the entrance portal without any of the treasure they found there. The bubble pops at 11:00pm real time, so at 10:30 let your players know that they can feel their connection to this world weakening, so if they want to keep their treasure they should hurry up and haul it to the portal.
The Demon Parade
This only works if your setting doesn't have any civilization. On a regular cadence (probably every night) an unvanquishable horde of demons parades through the land of the living capturing any sentient beings and dragging them to the ninth circle. Or whatever. Maybe it rains iron javelins or napalm or something. Whatever it is, this event is utterly unsurvivable, so the characters MUST return to town on time or else they simply die without recourse.
At the end of the day, the first bit of advice is best: just talk to your players. We're all grown-ass adults who can play nice if we understand why the rules exist.