Which years/chapters of the manga is based the Gintama anime series? AFAIK, the Gintama manga series is been done for 15 years, when there is only 4 years of anime (though many of those manga volumes were made after the anime series, so it's impossible the anime is based on them). Which years/chapters of the manga is based the Gintama anime series?
My apologies, after being sought out I believe I didn't answer or read your question to the fullest.

You asked if any of the managa for Gintama was based on the anime. As I had to re-read your question, the answer to your question is none of it as far as I have read. You said the anime has been done for 15 years is false, the anime(assume your taking about the first to third season of said anime) started in 2006 then ended in 2009. 

The manga that show is based on only came out about two years prior in it's initial Japanese release. The manga to anime followed this trend for awhile, with some arcs being dropped or switched out.

More episodes of the anime have came out in recent years with Gintama. Shirogane no Tamashii-hen having aired in January. 

So re-state what i am trying to say in less words.
1. the anime has not been done for 15 years, it has continued with the latest airing of a new anime being in January.
2. the anime and manga have taken a break or two over the years due to various factors (artist health being one of them.)
3. None of the manga has been based on the anime, considering the manga chapter the anime is based on dropped two years prior to the anime episode being released.