It is narrated from Sayyiduna Salamah bin al-Akwa' (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) said: "Any man and unmarried woman who agree with each other, their companionship is for three nights; then if they wish to extend it, they may extend it, and if they wish to part, they may part."
Hadith Referenceالمعجم الكبير للطبراني / باب السين / 6239