The main character is surely Gintoki Sakata. He's the central figure in the Gintama series and would likely play a crucial role in the 'Ending Story' as well.
I recommend the book "Possibly a Fake Silver Soul". It tells the story of Jiang Cheng, a transmigrator, who met the owner of Xinghai District and his girlfriend, Jiang Hua, who were traveling in the universe in the dragon vein of a certain planet. Later, he came to Earth and met his teacher, Yoshida Shoyo, who had influenced his life. He also met a group of friends. This included the transmigrator Okita Soki. This is a Silver Soul Doujinshi novel, don't miss it. I hope you like this fairy's recommendation. Muah ~😗
Typically, there would be the students of Class 3 - Z. However, without reading it in detail, it's hard to say exactly who the main characters are among them. But it's likely that there are some standout students who take the lead in the various adventures and storylines.
Gintama is purely fictional. It's filled with imaginative characters and scenarios that are not rooted in real-life events. The creators crafted a unique and entertaining fictional world for the audience.