We're glad you asked this question, because we haven't really mentioned this until now, and it might've caught your attention: the book is called "2 Samuel" but Samuel the Prophet isn't actually in it. In fact, he died toward the end of 1 Samuel and is later summoned back from the dead by Saul. So, um, why isn't this one called "David"?
1 and 2 Samuel were originally part of one book, but they were later divided at the moment where Saul dies and David starts to become the biggest Kahuna in town. Jewish tradition stated that Samuel wrote the books of Samuel, but that the prophets Nathan and Gad filled in the parts he couldn't have written. Today, the vast majority of scholars believe that the book was put together from multiple sources from different time periods at around 600 B.C.