I have some questions about sexual activity during Ramadan.

If I sleep with my wife after Iftaar, is there a certain timeframe which I have to do Ghusl within?

And: if I have a sexual dream, do I have to do Ghusl before Dhuhr-prayer? If yes, what do I do if I wake up after the Dhuhr prayer has entered, and then realize I’ve had a wet dream?

Yes you must make ghusl janaba before dawn.

In second scenario if you have a wet dream in the day you need to make the ghusl janaba before you make salat whether you woke up before zuhr or after zuhr had entered.