That's right. The books that are traditionally believed to have been written by people who actually knew Jesus are:
Matthew
John
1 Peter
2 Peter
1, 2, and 3 John
James
Jude (I think)
Revelation
Of these, only 1 and 2 Peter, James, Jude, and Revelation actually name their authors - the others are all anonymous (the letters of John claim to be from "the elder"). 1 and 2 Peter claim to be by Peter. Revelation claims to be by someone called John, but it is not implied that he is John the apostle (there were lots of people called John at this time, and in fact quite a few are mentioned in the New Testament).
In the second century, it was believed that the Gospel of John was written by "the beloved disciple", a character in that Gospel who is not named. The theory went that this was the author's way of referring to himself, and he was John (not sure why). John was also believed to have preached in Ephesus and to have lived there a very long time, becoming the last apostle to die. 1, 2, and 3 John are written in similar language to John's Gospel, so it was assumed they were by the same author. And the John of Revelation was assumed to be the same person. All fairly reasonable by the standards of ancient scholarship, perhaps.
All wrong, though. There is no reason to suppose that "the beloved disciple" is John, or indeed a real person at all; the letters 1 John, 2 John and 3 John are not by the author of the Gospel; and Revelation is by someone else entirely. Interestingly, some ancient Christian scholars such as Dionysius of Alexandria worked this out for themselves.
Matthew wasn't written by Matthew - I'm not sure what the basis was for supposing that it was. The main reason you can tell it wasn't by Matthew is that it's based on Mark, and if you'd been a personal friend of Jesus you would hardly base your book about him on someone else's book (and one written by someone who *didn't* know Jesus).
Mark is traditionally thought to have been written by John Mark, a disciple of Peter's, and therefore to contain Peter's own reminiscences, though not in his own words. But really there's no reason to suppose that this is true. Similarly, Luke is traditionally thought to have been written by a companion of Paul. This is because Acts is by the same person, and it sometimes slips into the first person plural when describing Paul's journeys. In fact, this can be explained far more simply as a common rhetorical device. Thus, the traditional attributions of the Gospels are almost certainly wrong, and as far as we know they have nothing to do with any direct contact with Jesus. But you could tell that anyway simply from examining their contents and seeing how the stories have been shaped by their oral transmission over the years before being written down. They are clearly folk literature, not personal reminiscences or even "biography" or "history" of the sort done by Greek historians (notwithstanding Luke's preface to his Gospel, which attempts to put it into that sort of genre).
1 Peter is very probably not by Peter, being apparently based in part on the theology of Paul. 2 Peter is certainly not by Peter, being apparently the latest book in the New Testament to be written, probably from the second century and based in part on Jude. Jude is also late, although not quite as late. But they don't tell us anything about the historical Jesus anyway.
The same for James. It's not clear which James is supposed to have written this - James the brother of John, or James the brother of Jesus? The former was a disciple of Jesus, while the latter was not, but became a Christian later on and led the church in Jerusalem. Like the letters attributed to Peter, it seems that this was written by someone who wanted to attach an important name to his work. The book is concerned with opposing Paul's theology, of course, not with telling us anything about the historical Jesus.
The only books of the New Testament that were definitely written within the lifetime of the apostles - that is, of people who had actually known Jesus - are the letters of Paul. These are Romans, 1 Corinthians, 2 Corinthians, Galatians, Philippians, Philemon, and 1 Thessalonians. They apparently date from about AD 50 to the late 50s (perhaps). The other letters attributed to Paul are either possibly not by him (2 Thessalonians, Colossians) or definitely not by him (1 Timothy, 2 Timothy, Titus, Ephesians). But of course, Paul did not know Jesus, and again his letters betray relatively little interest in what Jesus did during his lifetime (although they do parallel quite a lot of Jesus' ethical teaching).
You can get lots more useful info on all this stuff at
http://www.earlychristianwritings.com/ which is a very good site for information on the state of scholarship on these books.