If you want to visit Kurama-dera you have to get to Kyōto first. You can take a Shinkansen from Tōkyō: travelling on the Nozomi, the shortest journey takes about 2 hours and 15 minutes and costs 14.000 yen. Remember, however, that if you use the Japan Rail Pass, you may not take the Nozomi, but have to ride on the slightly slower Hikari or Kodama services.
At Kyōto Station, take the Nara Line (which is a JR line covered by the over mentioned pass): once you reached Tōfukuji Station you can take the Keihan Main Line. Ride to the final stop, Demachiyanagi Station, where you have to transfer on the Eizan Railway. Get off at the last stop Kurama Station. The journey from Kyōto station to Kurama station costs 830 yen.