The airport is the one place in Dubai where you will never have issues getting a taxi, regardless of what time you are arriving. In fact, at 2 AM it’s gonna be easier because there are not a lot of flights at that time. When you arrive at a busy time you might have to cue for cabs, but even that has never taken me longer than 10 minutes.
However if your hotel offers complimentary pick and drop service, which many hotels do, I’d take that.