I'd have to know more information about this stringer. Is this one on the pressure hull or just in the casing?
If it's in the PH, it would probably run the entire length of the boat. As the purpose of a stringer is basically to keep the correct spacing of the ribs and add some strength, there'd be no point in putting it in unless it went the entire length.
However, if it's a stringer in the casing, then I'd have to know where in the casing you're talking about. Because the casing of a U-boat is a sort of add-on, it's possible for the stringer to be only partial length. It might stop when the side of the casing meets the PH, or it might go the whole length, or it might only be a partial strengthener for a limited section of the casing.
I can see on the outside of the casing, a double line of rivets that look like they might be the attachment of a stringer running just under the free-flow holes both fore and aft, but it looks like it stops when it meets the saddle tank. Is that where you're talking about?
Usually a stringer will be added inside the ribs, but it's possible in some constructs for it to be faired into the ribs, especially in a U-boat casing where the ribs are thicker than normal.
In surface ships, a stringer is also commonly a point where an interior deck attaches, in which case it depends on the deck locations whether it goes the length of the hull or not. However, obviously that's not a consideration for a U-boat casing, since the only decks are inside the PH or the top of the casing. However, it's possible for there to be a stringer inside the PH to be used for attaching the deck.