"It was a dream for me to win a world title," the 23-year-old said after the 54-minute match.
"I was shaking like a little child inside... Lin Dan is an idol for me," added the world number three, who has beaten Lin four times in seven meetings.
Okuhara, the first player from Japan to win a singles gold medal, edged Sindhu in a match lasting 110 minutes, the longest of the tournament.
The Japanese struck with speed and precision to counter the Indian fourth seed's piercing crosscourt shots to edge the first game.
Both players rallied relentlessly in the second, in which Okuhara saved three game points but could not prevent Sindhu from drawing level. Okuhara held her nerve in the decider as Sindhu struggled with exhaustion.
In the women's doubles final, China's 20-year-old pair of Chen Qingchen and Jia Yifan outlasted Japan's Yuki Fukushima and Sayaka Hirota.
The fierce battle that at one point produced a 104-shot rally went the Chinese pair's way in 84 minutes.
China's Liu Cheng and Zhang Nan defeated Indonesia's Mohammad Ahsan and Rian Agung Saputro 21-10 21-17 to seal the men's doubles title.
(Reporting by Shrivathsa Sridhar in Bengaluru, editing by Ed Osmond)
