How can I apply license to my own plugin?

Is it automatically applied to it when I put my product on the market? Or do I need to do something else?

Yes your product will either has Standard or Extended License or both applied to it when you upload to the marketplace.

Dont I need to set up some UI for users so they can enter codecanyon license key?

It is optional but if you like to setup a verification process you can do it through purchase code verification systems using envato api: https://build.envato.com