Yes if a package was accidentally delivered to your address and you keep it then you could be charged with theft if you do not return it.
The UPS driver or USPS, FedEx etc can know where they delivered the package and then when they are notified they delivered the package to the wrong address they will come by to try and get it back.
If you fail to give the package back to the UPS driver, USPS mail carrier or FedEx then you can be charged with theft of the package.
The best thing to do is to just return the package or call UPS or whoever delivered it and let them know they delivered the package to the wrong address.
I would not want someone keeping my packages so I would not want to keep others packages as well.
If the address is on the same street and you know the house address then you can take the package over to the house yourself.
I've done that myself.
The UPS delivered a package to the right number of house but just on the wrong street.
I then took it around the block a few blocks away and delivered it to the correct address and the person was very thankful that I did that.