4 is the minimum. 2 for just you and a dock. 2 for the opposite side if you come into a place with multiple docks that allow 2 boats side by side.
I also put 2 on the open side if I can expect company. I like to say preventing the neighbor from dinging my boat but it’s just as true so I don’t hit theirs. Go to one of these restaurants and watch people dock for a while. Some are good, some are okay, and then there’s the train wrecks
Edit: depending on your boat you may want 3 for each side. ex. long pontoon. More than 2 doesn’t do a lot for me on my 17ft aluminum or 22ft glass boat because of where they get placed.