Depends on the scale of the loss:
1. Less than, say, 150 seats: Corbyn goes, ten years or more of Labour in the wilderness, and perhaps eventually they'll work out how to get elected again without also being basically just Tories.
2. Something not much less than what they have now: Corbyn stays, on the (perhaps reasonable) grounds that Labour picked up more votes overall than in 2015 (or even 2010), so that he does have popular support and a platform to build on finally. However the small losses mean that the PLP still doesn't believe Corbyn is electable, and divisions last for years to come.
3. Labour increase the number of seats they own without stopping a Tory Majority: Corbyn stays, and can claim reasonably that he's electable even despite the loss, having had too much ground to make up in terms of seats but still increasing the vote share massively. MPs fall in line and all then depends on whether the electorate want to punish May for delivering a "bad" deal, or reward her for a triumphant return from negotiations.