Travel times very much depend upon the time of day. Weekday rush hour traffic could turn a 45-minute cab ride into an hour and 45. And any special events could have a similar impact. I would plan on an hour ride each way but know that you shouldn't cut it too close. Get in early, leave late, and enjoy all the time you can at Times Square, Central Park, and The Met.
I have done it and it's fine. It took me 1 hour to get to the airport from Times Square last time I was in town. It could be less or more. I would allow myself at least an hour if not an hour and a half to get to the airport depending on the time.
Thanks! Your answer is awaiting moderation.