For Rabbi Shimon ben Lakish said: The Holy One, blessed be He, places an additional soul in a person on the eve of the Sabbath, and at the conclusion of the Sabbath they take it from him, as it is said, "He ceased from work and rested" (Exodus 31:17 - shavat va-yinafash). Read it as: once the Sabbath has ceased (shavat), woe (vai)! the soul is lost (avedah nefesh) [the plain sense being "He rested and was refreshed"].
The Second Soul
Beitzah 16a
דְּאָמַר רַבִּי שִׁמְעוֹן בֶּן לָקִישׁ: נְשָׁמָה יְתֵירָה נוֹתֵן הַקָּדוֹשׁ בָּרוּךְ הוּא בָּאָדָם עֶרֶב שַׁבָּת, וּלְמוֹצָאֵי שַׁבָּת נוֹטְלִין אוֹתָהּ הֵימֶנּוּ, שֶׁנֶּאֱמַר ״שָׁבַת וַיִּנָּפַשׁ״, כֵּיוָן שֶׁשָּׁבַת וַוי אָבְדָה נֶפֶשׁ.