I would like to find out what is the latest time we can pray magribain namaz without them being qadha.

It is best to pray it before midnight, however, it can be prayed before Fajr without the niyyat of ada or qaza.