In this circumstance, "la" is an indeterminate pronoun and it implicitly refers to something negative.
Both those sentences are grammatically correct, but I would argue that they have slightly different meanings.
finirla = "Troncare, far cessare, smettere", "a proposito di liti, contrasti, questioni noiose e sim." (Treccani, definition
e.). You may specify
di + <infinito> but it can also stand alone. This sounds like actively putting an end to a negative action to me.
finire di + <infinito> = "Giungere al termine di" (definition
d.). This sounds more neutral to me, as if it's reaching the natural end of an action.
A personal note - both sentences are rather odd: of course someone would stop asking for something once they receive it; so the conditional clause, as it stands, is meaningless. It would make more sense if it were
Ti comprerò una bicicletta nuova purché tu la finisca di importunarmi.