1. Lunch is on me.

2. What do you mean by "lunch is on me"?
3. I mean I will pay for the lunch.
4. Thanks a lot. I really enjoyed the lunch. Then ice cream is on me.
------------------------
In #3, why is 'the lunch' used?
In #4, 'the lunch' is used. Why is that? Is 'the lunch' mean the specific lunch which was payed by the other person?

All the sentences are fine, yes.

And yes, in both 3 and 4, "the lunch" means that particular meal that the two people just ate at a restaurant or cafe.

You can either keep "the" with "lunch" or omit it -- either way works fine.

In sentence #3, the phrase "the lunch" is used to refer to a specific meal that the speaker mentioned earlier. By using the definite article "the," it implies that there is a particular lunch being referred to, which is the one the speaker offered to pay for.

In sentence #4, the phrase "the lunch" is used again to refer to the specific meal that was previously mentioned. In this case, it is the lunch that the speaker enjoyed and was paid for by the other person. By using "the," it emphasizes that it is a particular lunch that is being referred to, rather than just any lunch.

In #3, the phrase "the lunch" is used to refer to the specific meal that the person is offering to pay for. By using the definite article "the," it indicates that the speaker is referring to a particular lunch that is being mentioned in the conversation.

In #4, when the person says "Thanks a lot. I really enjoyed the lunch. Then ice cream is on me," they are specifically referring to the lunch that was mentioned previously. By using "the lunch," it indicates that they enjoyed the specific meal that was paid for by the other person. Essentially, they are saying that since they enjoyed the lunch, they will now treat the other person to ice cream.