This question already has an answer here:
I am travelling to Durban on 21.10.2017. I will be reaching Dubai at 22:00 at Terminal 1 and my next flight to Durban is at 10:45 the next day from Terminal 3. This means I will have to remain at Dubai Airport for 12 hours 45 minutes in total.
As the layover time is quite long, do I need to have a transit visa if I stay within the airport terminals and does not come out?