Short answer. You must return it to the person who last had it. If that person is unknown, Article 719 requires you to deposit it immediately with the mayor of the city or municipality where you found it, who then publicly announces the find for two consecutive weeks.
What the law says
Whoever finds a movable, which is not treasure, must return it to its previous possessor. If the latter is unknown, the finder shall immediately deposit it with the mayor of the city or municipality where the finding has taken place. The finding shall be publicly announced by the mayor for two consecutive weeks in the way he deems best. If the movable cannot be kept without deterioration, or without expenses which considerably diminish its value, it shall be sold at public auction eight days after the publication. Six months from the publication having elapsed without the owner having appeared, the thing found, or its value, shall be awarded to the finder. The finder and the owner shall be obliged, as the case may be, to reimburse the expenses.
Civil Code, Article 719 — Duty Of A Finder Of Lost Movables. Read the full provision →
The first duty is to return it, if you can
Article 719 states the basic rule plainly: whoever finds a movable, which is not treasure, must return it to its previous possessor. If you know or can identify who last had the item, your obligation under this article is to give it back to that person directly. The more detailed procedure the article sets out only comes into play once that direct return is not possible because the previous possessor is unknown.
When the owner is unknown: deposit with the mayor
Where the previous possessor cannot be identified, Article 719 requires that the finder shall immediately deposit it with the mayor of the city or municipality where the finding has taken place. The word immediately matters — the obligation is not to hold onto the item indefinitely while trying to locate the owner yourself, but to hand it over to the local mayor's office without delay once you cannot identify who it belongs to.
Public announcement, and what happens if the item won't keep
Once deposited, the finding shall be publicly announced by the mayor for two consecutive weeks in the way he deems best — giving the true owner a real chance to come forward. If the item cannot be kept without deteriorating, or without expenses that considerably reduce its value, Article 719 allows it to be sold at public auction eight days after the publication, so that whatever value it holds is not lost while waiting for the owner to appear.
What happens after six months
If six months from the publication pass without the owner appearing, Article 719 awards the item itself, or its value if it was sold, to the finder. The article also provides that the finder and the owner shall be obliged, as the case may be, to reimburse the expenses — meaning whichever of the two ultimately ends up with the item is responsible for covering the costs the process generated, such as the expenses of keeping or selling it.