World number nine Li was dealt a blow early on in the first set when she dropped a service game, but she broke Sharapova back twice on her way to a 6-4 win.
The Russian looked to be heading for a straight-sets defeat as Li raced into a 4-0 lead in the second, but 24 unforced errors allowed Sharapova back into the match to take the set 6-4.
It was the world number two who appeared the most likely to win the deciding set with two service breaks, but Li fought back to force the tie-break.
Both players moved for cover before the tie-break started as rain caused a lengthy delay in the Italian capital.
When play resumed Sharapova overwhelmed Li to secure the title with a 7-4 victory.