In Game of Thrones, there are two noteworthy things about Winterfell from Littlefinger's perspective. First of all, it's going to be one of the first places in Westeros that are going to have to defend themselves from the Night King's march. Secondly, it is currently ruled by Sansa Stark, whom he is trying to marry.
Sansa has no interest in him. In fact, she openly shows dislike and distrust of him. And of course, Littlefinger should have no interest in sacrificing himself or his Vale soldiers against the Night King either.
So, why is he still in Winterfell by the end of season 7? Why doesn't he just leave with the Vale soldiers? From his perspective, the best action seems to be to get the hell out of dodge, no? Maybe hope to survive the war, and then take advantage of post-war instability to gain more power?