There are ticket machines at some stops, but not all of them. Then you just can buy the ticket with a contactless credit card inside of the tram. But don‘t worry, when you will get no paper ticket. How this all works is explained here in our post about how to get around with tram in Wroclaw.