There is no simple hard fast rule. Many factors come into play. Bullet design, composition, muzzle velocity, weight, distance from muzzle, etc. all must be considered. Generally the faster and bigger the better, but sometimes you can shoot a bullet faster than it was designed to impact a target. It is not at all unusual to see the same exact bullet give much more penetration at slower speeds because at high speeds it comes apart.
Bullets are designed to perform best within a range of impact velocities. If they hit the target too fast they may come apart and not give enough penetration. If moving too slow, they may not expand and will not give satisfactory performance either.
For example in hunting situations it is not unusual to see a 308 perform much better than a 300 win mag at close range. The 300 bullet is impacting at up to 600 fps faster and may not give enough penetration. At extreme long range the 308 may hit the animal you are hunting, but the bullet may be moving too slow to expand. The 300 is still within the acceptable velocity range to give good expansion at longer range.
That is where different bullet types and composition come into play. Hollowpoints help bullets expand at slower speeds than would normally be possible. This is why they are common in handguns, but much less so in rifles.
And then there is the bullets composition. The new solid copper bullets cannot be shot fast enough to come apart. They are a tougher bullet and give good expansion and penetration at high speeds. In fact the faster you shoot them the more accurate they get and give better performance on game. Their disadvatage is that they do not expand well if they impact at speeds below 2000 fps. They are not a good choice for longer range shooting at game.