The end of the time for Maghrib and 'Isha is the middle of the night in the case of the delay being voluntary.
Middle of the night here means the middle between ghurub of the sun and Fajr time. This means it would depend on location and time of the year.
If the delay is not voluntary, and one has an excuse, like ending menstrual cycle after the middle of the night, or sleeping, or unconscious, then the time would extend until before Fajr.
Please refer to your Marja' taqleed for details.
And Allah knows best.