This is perhaps the single most asked question we deal with in the Japan Forum. I invite you to look at the "sticky" post immediately above yours for an in-depth discussion of layover options. Short answer, with such a short layover, a 10 minute ride into Narita City is the better option. There is a nice temple to visit, an active shopping street to explore and several good restaurants for a nice lunch or dinner before heading back to the airport.
What visa - if any - you will need depends on what passport you are traveling on. If US, you wont need anything special to get a shore pass. Just grab a few yen from an ATM and go to the Japan Rail ticket center for the train to Narita.