If an action or activity is worth someone's while, it will be helpful, useful, or enjoyable for them if they do it, even though it requires some effort.
Is it worth while or worth the while?
In terms of meaning, there is no difference between the two words. When you say that something was 'worthwhile', you mean that the time, money or energy you spent on it was worth it. In other words, you are quite happy with the result.
What does it mean worth your while?
make something worth one's while. Compensate one for one's time or efforts, as in If you take care of our yard while we're away, I'll make it worth your while. [Mid-1800s] Both usages employ while in the sense of “a period of time spent.”