Generally I think ~12 episodes is too short to tell a story. Most U.S. popular show are 24 episodes(I am not saying they are good just popular) and they are 50 mins long each. 12 ~24 minute episodes is just not long enough to tell a good story IMO. However, some stories don't need much time and this is a good choice for some shows (Usually fanservice shows).
Shows around 24 episodes can begin telling a good story. They have enough time for plenty of characterization. And this is usually not so long where jokes get repeated and there is lots of filler.
Shows ~50 episodes are probably optimal, because there can be a good ratio between story advancing episodes and filler. If you cannot characterize someone in ~50 episodes, you are doing something wrong. If you can't end a story in that long, something is wrong.
A few decent shows can continue on past 50 episodes, but they usually have to be comedy. A good example of a long running show is Kerero Gunso. But even in this show, jokes start to be repeated and you can see the formulas they use for the episodes. Even after 200+ episodes, the story hasn't even advanced that much, and the story often gets "reset" and goes back like nothing has happened.