Tokyo is served by a mix of Japan Rail trains, Tokyo Metro subway lines and a handful of private rail companies. Using a navigation app like Google Maps is helpful.
Fares are charged based on how far you travel, but save yourself a headache and get a Suica (JR) or PASMO (Tokyo Metro) prepaid IC card. They work across all lines and automatically deduct a (slightly reduced) fare when you pass through any gate. Suica cards are available at the JR office at Narita Airport. Any remaining balance can be cashed out when you head home.