The verb sojourn comes to us from the French sojorner, which, with the related Italian soggiornare, has been traced to the Popular Latin subdiurnare, compounded from sub, “under,” and diurnus, “day-long” (from dies, “day”).
Thus the original sense was applied to some event lasting for less than a day, especially a short visit.
The sense has become expanded with time, until now to sojourn is to visit for any length of time, but not permanently, and a sojourner is one who is temporarily staying somewhere other than at home.