To discuss the differences of your examples, one is longer than the other.
This means the drive train of the bike will be better-protected.
Here's the shorter ones on a bike. You can see how water flicked off the back wheel will not hit the rider, but water will saturate the crank area and top/bottom chain run and crankset.

Remember that road water is utterly filthy and contains all sorts of contaminants, ready to wear out your drivetrain like a grinding paste.
Ideally a full rear mudguard/fender would come right around the tyre and go down to even with your bottom bracket, or just below. Some designs use a plasticky/rubber/leather skirt to help extend the effective end of the guard.
The front guard should hang low at the back too - should come down as low as reasonably possible to minimise front wheel splatter (that what hits you in the face while turning.)
Second difference is that one set is clip-on and the other set is bolt-on. I personally own a set of each style, and once fitted they're functionally the same.
However clipon ones are easier to take off if you want to race, or not carry that weight up a hill. Bolt on ones can't slip, but if they snag an obstruction, then its more likely to stop you than snap off safely. Modern bolt-on styles often have a breakaway connector somewhere.
Clipon ones may also damage paintwork if they get some road grit between the pads and the frame, and they may end up a bit wobblier due to the angles of the supports. Also clipon ones may not attach to the brake bridge either which is one fewer support, adding to potential wobbliness.
Lastly, brake clearance is often the main stopper as per other answers. If you have disk brakes then they can interfere with where the left-side strut/stay goes.
Some bikes also give issues at chainstay and seat stay areas. Notice the longer mudguards/fenders have a break around where the brakes are, to allow for this.
Bikes with long-arm V brakes tend to take mudguards fine. Mini V brakes not so much, and calipers maybe harder.
Other solutions
You can fit a carrier rack and then line that with flat plastic.
There are solutions that involve recycling an old tyre or old bottles as a guard on some homemade stays.
Regardless - mudguards make rain riding less bad.