For first time and if u've never been to Narita itself, I would recommend going there instead of going to Tokyo.
The street to the temple in Narita is quite interesting, with traditional Japanese wares, food and you can even see live eel skinning in one of the stores.
Behind the temple is a nice big Japanese garden.
There is also a regular shopping mall(Aeon mall) within walking distance from the temple.
Lots of restaurants around the mall and there is a pretty good conveyor belt sushi place outside the mall. They dont speak English though.
Personally, with a short layover, it's much less stressful to just stay around Narita town than go into Tokyo.
Tried both before and I prefer having a more relaxing time eating walking around and actually seeing things than spend it on the train.
With some extra time, u can also check out NRT airport.
There is an origami museum inside, shops etc.
As the others also mentioned, sometimes, due to weather or mechanical, the trains might stop running. If that's the case, you might miss the flight back.