I don’t write in Python, but the general process for something like this is you would need to set up a server that accepts a webhook notification of new issues. Then, you would use the information in the webhook payload to determine if your server would take some sort of action. If it were to take some action, it would use the GitHub API (either REST v3 or GraphQL v4) to do that. For your example of adding a label, the REST v3 API for adding a label to an issue would be used.
Unfortunately, the specifics of building a server process and getting it hosted somewhere is out of scope for this board. But if you’re open to using Node, you could look at using the tools that Probot provides to make some of this more simple.
I hope that helps!