Heathrow is a major, major airport, with flights arriving 24 hours a day. (Officially they're not scheduled that late, but delays happen.) Taxis at Heathrow are electronically tracked, and automatically dispatched to different terminals as needed to satisfy demand.
Short of a strike, terrorist attack, or other unforeseeable event, it is a given that you'll be able to get a taxi quickly at any Heathrow terminal at any time.
With that said, as a commenter mentioned, if you're at all worried then you should order a private-hire car, which will be more convenient (as the driver will meet you), dependable, and likely cheaper as well.