Here are some small history lessons behind
the names of some of the characters and
places in Gintama!
His name overall is a reference to the Japanese legend of Kintaro, which is about a child with massive strength during the Heian period (rather the later Edo period that Gintama takes place in). Kintaro became friends with the animals that lived on the mountain where he was raised, and was even capable of battling with them. After certain events, he became a samurai and eventually went under the name Sakata Kintoki (坂田公時). In one of the Question Corners, Sorachi explains this and doesn't intend on making Gin-san a descendant of Kintaro.
There are random times when he is actually called Kintoki. Sakamoto mistakes Gintoki's name all the time, the OWee gaming console was unable to fit all the characters of his name (き/ki took one space while ぎ/gi took two), and the Gintoki in Gintama's alternate universe "Kintama" had golden hair and was called Kintoki.
Kagura's name comes from a Japanese folktale called "The Tale of the Bamboo Cutter", also known as "Princess Kaguya". She grew up to be a beautiful young girl, knowing that she would one day need to return to the moon where she came from.
It should be noted that Takasugi references the legend when Kagura appears behind him on the Kiheitai ship during the Benizakura arc.
When the characters of Gintama were being made, Shinpachi was originally going to be a part of the Shinsengumi as Nagakura Shinpachi (永倉新八), who was the captain of the Shinsengumi's second unit. Instead, he was given glasses and became the one to throw the punch lines, receiving his last name from Shimura Ken (志村けん), a Japanese comedian.
Otose is the wife of Isuke (not Tatsugoro!), a farmer from Terada Village. Isuke founded the Terada Inn, which was a gathering place for ronin pro-imperal loyalists. Two big events transpired at this location, one which was Sakamoto Ryoma's encounter with a dangerous ambush.
Katsura gets his name from Kido Takayoshi who went under the name Katsura Kogoro (桂小五郎) when he was adopted into the Katsura family at a young age. At one point in time, he was also given the title "Runaway Kogoro" (逃げの小五郎/nige no kogorou). In the Japanese drama "Shinsengumi!" that Sorachi-sensei used to get some of his ideas from, he would always be known to elude capture.
The special police force of Gintama is undoubtedly based on the historical special police force of the late shogunate period, previously known as the Mibu Roshigumi. Sorachi-sensei simply used a different kanji for "shin" ("true" instead of "new") which preserved the pronunciation, changing 新選組 to 真選組. The uniforms are obviously different, but the names of some of the main faces remain loosely based on their real-life counterparts.
Sorachi-sensei revealed the rest of the captains and inspectors in Volume 11.
1st Unit Okita Sogo (沖田総悟) Okita Soji (沖田総司)
2nd Unit Nagakura Shinshichi (永倉新七) Nagakura Shinpachi (永倉新八)
3rd Unit Saito Shu (斉藤終) Saito Hajime (斎藤一)
4th Unit Sugihara Chuji (杉原忠司) Matsubara Chuji (松原忠司)
5th Unit Takeda Kannensai (武田観念斎) Takeda Kanryusai (武田観柳斎)
6th Unit Inoue Genjiro (井上源二郎) Inoue Genzaburo (井上源三郎)
7th Unit Oka Sanjuro (丘三十郎) Tani Sanjuro (谷三十郎)
8th Unit Todo Bokosuke (藤堂凹助) Todo Heisuke (藤堂平助)
9th Unit Niki Jiro (二木二郎) Suzuki Mikisaburo (鈴木三木三郎)
10th Unit Harada Unosuke (原田右之助) Harada Sanosuke (原田左之助)
Yamazaki Sagaru (山崎 退) Yamazaki Susumu (山崎 烝)
Shinohara Shinnoshin (篠原進の進) Shinohara Tainoshin (篠原泰之進)
Yoshimura Oretaro (吉村折太郎) Yoshimura Kanichiro (吉村貫一郎)
Based on Kondo Isami (近藤勇), commander of the Shinsengumi and close friend to Hijikata Toshizo. Kondo was known to own a katana named Kotetsu, but some think that it was fake. Perhaps that's why, in Gintama, Kondo accidentally breaks Kotetsu-chan before paying off the loans, and later purchases Kotetsu Z-II which easily (and purposely) gets broken by Sogo.
Based on Hijikata Toshizo (土方歳三) who, with Kondo Isami, formed the Shinsengumi. He was the Shinsengumi's vice-commander, and was known as the demon of the Shinsengumi. Hijikata strictly enforced rules in the Shinsengumi, leading to the creation of the Kyokuchu Hatto (the clauses or regulations for the Shinsengumi) to control the members, but it also caused many to lose their lives.
Based on Okita Soji (沖田総司), the captain of the first unit of the Shinsengumi. Soji was a prodigy and was seen as one of best swordsmen of the Shinsengumi. Though just a rumor (but at least true in Ryotaro Shiba's novels), he may have owned a katana called Kiku-ichimonji. In Gintama, he bought the Kiku-ichimonji RX-78.
Based on Matsudaira Katamori (松平容保) who was military commissioner to maintain peace in Kyoto. As well as other units, Katamori had some control over the Shinsengumi. Not so historical, but Sorachi said Matsudaira's model is Robert De Niro.
Based on Yamazaki Susumu (山崎 烝), a Shinsengumi officer who also acted as their spy.
Based on Ito Kashitaro (伊東甲子太郎), formally known as Suzuki Okura before joining the Shinsengumi. He was highly educated and was admired by Kondo Isami. Rumor has it that Hijikata disliked Ito when he joined and became suspicious of his true motives for joining. While gaining the Shinsengumi's trust, Ito was secretly meeting with Satsuma clan members and had even made plans to assassinate Kondo. Ito was later assassinated by the Shinsengumi members.
Ito also likely got his name from Serizawa Kamo (芹沢鴨) who was also a commander of the Shinsengumi.
Like the Shinsengumi, the Mimawarigumi too was a special police force, created to restore order to Kyoto. The Mimawarigumi were made up of higher-ranking samurai and retainers who served feudal lords, as opposed to the Shinsengumi which consisted of ronin.
In Gintama, the Mimawarigumi appeared wearing opposite colors of the Shinsengumi.
Sasaki Isaburo is the commander of Mimawarigumi, who shares his name with the leader of the real Mimawarigumi, Sasaki Tadasaburo (佐々木只三郎).
Imai Nobume is a female member and a part of the assassination unit of the Mimawarigumi. She is influenced by ex-Mimawarigumi member Imai Noburo (今井信郎), who had confessed that he was involved in the assassination of Sakamoto Ryoma with Tadasaburo and others.
Okita Soji had two older sisters, the eldest being Mitsu (沖田みつ). Soji later suffered from tuberculosis and Mitsu took care of him until his passing. In Gintama, Mitsuba was in poor health and Sogo took care of her.
Influenced by Sakamoto Ryoma (坂本龍馬) of the Bakumatsu period who was an imperial loyalist. Another way to pronounce the "ryou" kanji in Ryoma's name is "tatsu" (kanji means "dragon"), but Sorachi-sensei cleverly uses a different kanji to achieve the same results. At one point, Ryoma envied the west for their power and technology but eventually became familiar with them. Though proficient in Kendo and was a samurai, he preferred guns over the sword.
In Gintama, Tatsuma is the leader of the Kaientai, which is also the name of the first modern corporation in Japan that was founded by Ryoma.
History says Kido Takayoshi was forced into hiding with a geisha named Ikumatsu who eventually became his wife. If you remember Lesson 55/Episode 39, Katsura was injured by the Shinsengumi and had to go into hiding. He ended up staying at Ikumatsu's ramen shop, and in return helped her out with her troubles. He later revisted when Edo TV was doing an interview with him.
Gets her name from Mutsu Munemitsu (陸奥宗光), a diplomat and one of the members of Sakamoto's Kaientai.