Sayyidah Aishah Siddiqah (may Allah be pleased with her) says: The prayer was made obligatory as two rak'ahs and two, except for the Maghrib prayer, which had three rak'ahs because it is odd. Sayyidah Aishah (may Allah be pleased with her) says: When the Prophet (peace and blessings be upon him) travelled, he would offer the original prayer (i.e. two obligatory rak'ahs), except for the Maghrib prayer; and when he was resident, he would add two more rak'ahs to the two rak'ahs, except for the Maghrib prayer, because it is odd, and the morning (Fajr) prayer, because in it he would lengthen the recitation.
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الصلاة / 2931
Hadith Gradingمحدثین:إسناده ضعيف, قال الهيثمي:رواه أحمد والطبراني في الأوسط، وفيه ابن إسحاق، وهو مدلس وقد عنعن (2/153)