The Messenger of Allah ﷺ said, "It is not lawful for a woman who believes in Allah and the Last Day to undertake a journey of three days or more unless she is accompanied by her father, her brother, her husband, her son, or another close male relative within the bounds of Muharram kinship."
حدثنا أحمد بن منيع حدثنا أبو معاوية عن الأعمش عن أبي صالح
قال رسول الله ﷺ لا يحل لامرأة تؤمن بالله واليوم الآخر أن تسافر سفرا يكون ثلاثة أيام فصاعدا إلا ومعها أبوها أو أخوها أو زوجها أو ابنها أو ذو محرم منها
Muslim also narrated it, Hajj, chapter on a woman traveling with a mahram for Hajj or otherwise, hadith 1340, from the hadith of Abu Muawiya Dareer, with the same wording. The hadith has other routes in Bukhari and Muslim and others, from Abu Saeed Khudri, with the same wording.On this subject there are also narrations from Abu Hurairah [coming up at 1170], Ibn Abbas [Bukhari, hadith 1862, and Muslim, hadith 1341], and Ibn Umar [Bukhari, hadith 1086, and Muslim, hadith 1338]. The hadith of Abdullah bin Amr bin As is in Ahmad, 2/182. See also the coming hadith numbered 1585.