If somebody shares photos with you, you'll receive an email where you'll be able to accept, then you'll find his pictures in your Photos app as well, the images he chooses to share.
It shouldn't be possible that somebody uses the same Apple ID/iCloud ID as yours. Make sure your ID is visible in Settings - iCloud. If it isn't, then we'll know why these photos appear on your device. This can also happen the other way round: your images can appear on the other one's Apple device.
Another question, if the ID in iCloud is not yours: where did you get your device? It might still be connected to the previous owner's iCloud ID, and will get locked as soon as you have to restore or erase it.
If the iCloud ID is yours, remove it as soon as possible and use a different email address. In that case, someone else has access to your iCloud account, which also means to data saved to iCloud, to login information stored in iCloud, ...