1) If after picking up a lost object with the intent of keeping it, one has remorse and indeed returns it to its rightful owner, before the owner gave up hope of ever getting it back (halachically referred to as 'Yi'ush'), he has retroactively negated all the negative commandments he has transgressed and fulfilled the positive commandments he has forfeited (as we enumerated yesterday), and in addition has also fulfilled the positive commandment (Vayikra 5:23) of "V'Heishiv Es HaGezeilah, and you shall return the stolen item" (See Sm"a Siman 259:2)
This remorse, and the subsequent thoughts to return of the object, should happen immediately as for every moment that one holds on to something stolen with intent not to return it, he is obligated to perform the positive commandment of "V'Heishiv Es HaGezeilah, and not doing so is an additional "Bitul Asei, forfeiture of a positive commandment". (See Sh'ar Hatziyun Siman 606:2)
2) Even after the owner of the object gives up hope of ever getting his item back, i.e. he has Yi'ush, it is still obligatory to return the item to him.
According to some Poskim even in this case the negative commandment of "Lo Tigzol" is negated and the positive commandments of "V'Heishiv Es HaGezeilah" as well as "Hashev Teshivem" are fulfilled. (Shulchan Aruch Choshen Mishpat Siman 259:1 and Sm"a S"K 2. See Shach 259:1 where he quotes a whole list of Rishonim who maintain that once there was Yi'ush it will not negate the transgressions, and if the item is returned it is considered a "gift".)
All agree, however, that once there was Yi'ush the negative commandment of "Lo Tuchal L'Hisalem, do not turn a blind eye" is not negated. (Shulchan Aruch and Sm"a ibid.)