I have a few doubts regarding the use of the present perfect. I really hope you can have a look at them, too.

Thank you!!

1) How long ago did you (last?) see him?
2) When did you last see him?
3) How long haven't you seen him? (Is it wrong?)Haven't you seen him for a long time?
4) How long is it since you last saw him?
5) How long have you been in New York.
But How many times have you been to New York?

All are correct, except the first #3 is awkward. The second sentence in # 3 is much better.

You can omit "last" in # 1.

Of course, I'd be happy to help you with your doubts about the present perfect tense. Here are the explanations for each question:

1) How long ago did you last see him?
To answer this question, you can provide a specific time or duration. For example, "I last saw him a week ago," or "I last saw him three months ago."

2) When did you last see him?
This question is asking for the specific time or date when you saw him last. You can respond by providing the relevant information, such as "I last saw him on May 10th," or "I last saw him at the party last weekend."

3) How long haven't you seen him? (Is it wrong?) Haven't you seen him for a long time?
The first sentence, "How long haven't you seen him?" is grammatically correct, but it sounds a bit awkward. It would be more common to say, "Haven't you seen him for a long time?" to inquire about the duration since the last time you saw him.

4) How long is it since you last saw him?
This sentence is asking for the duration of time since you last saw him. You can respond by saying something like, "It has been two years since I last saw him," or "It's been months since I saw him last."

5) How long have you been in New York?
This question is asking about the duration of your stay in New York. You can answer it by stating the length of time, such as "I have been in New York for three years" or "I have been living in New York since 2015."

Additionally, you asked, "How many times have you been to New York?"
To answer this question, you can provide the number of visits you have made to New York. For example, "I have been to New York three times" or "I have visited New York twice."

I hope these explanations have clarified your doubts about the use of the present perfect tense. If you have any further questions, feel free to ask!