What do you mean by that?

What do you mean "lunch is on me"?
=====================
There are a lot of meanings of 'by.' What is the meaning of 'by' in the two sentences?

The word "by" is only in the first sentence. That word has MANY meanings!

http://www.merriam-webster.com/dictionary/by

Scroll down until you see definitions 6a and 6b. Those are probably the closest definitions you'll find for the usage in sentence 1.

In this dictionary, look at definition 6d:
http://www.learnersdictionary.com/definition/by