Gambhir, dropped on 30 and nearly run out on 49, made 97 to put India within sight of victory after openers Virender Sehwag (nought) and Sachin Tendulkar (18) both fell cheaply to fast bowler Lasith Malinga.
Man-of-the-match Dhoni (91 not out) and man-of-the-tournament Yuvraj Singh (21 not out) then finished the job.
Earlier Mahela Jayawardene made 103 not out as Sri Lanka posted 274 for six after winning the toss.