The excellent GTT (Gruppo Torinese Trasporti) website gives comprehensive details of all methods of transport.
You can buy tickets at many newsagents, tobacconists and bars. When you board the bus or tram, make sure you validate the ticket in the machine.
If you buy a Torino Card from the Tourist Office, it entitles you to free travel on all urban, suburban and out-of-town public transport, as well as free entry to most museums and places of interest in Turin and discounts on guided tours and other events. It costs 16 euros for 48hrs, 18 euros for 72hrs or 30 euros for 5 days. This is a very good idea because it saves you having to worry about buying tickets each time you travel.
If you want to go further afield, there are several railway stations in Turin but the main one is Porta Nuova where you can catch trains to towns and cities within the region, as well as long distance, intercity trains.

