If you plan on being in Prague for a while, you should purchase a multi-day public transportation pass that gives you free access to the metro, trams, buses, funicular, and ferries (keep it with you at all times). You also need additional passes if you want to travel to or within other Czech cities like Plzen, Budweis, Brno, or Marienbad. With a multi-day card, you do not need to stamp passes - but you may be asked to show your card by the Tram Inspector! You cannot buy passes ON the trams (don't ask the driver) - there are ticket windows and vending machines that sell passes in the metro and near some tram stops.
For short trips, you can purchase transportation passes and transfer passes at the station. You must stamp your pass with the machine on the tram, bus, or at the metro station. These one-way passes usually expire 30 minutes after they're stamped, so you may need to buy a second pass when you go back. The fine for being caught on a tram or in the metro without a stamped pass is about $50.00!
The Prague Public Transit Company Co. Inc. (in Czech: Dopravní podnik hlavního města Prahy a.s.) manages all means of public transport around the city of Prague: the metro, tramways, buses, 5 ferries, the funicular to Petřín Hill, and the chairlift inside Prague Zoo.