A girl in uniform. Note that this is what would a prescribed uniform would be like.
A typical Japanese schoolgirl in anime would have a short skirt, blouse with what is called the sailor collar (think Sailor Moon!) and long loose socks. The sailor collar is pretty much part of the prescribed school uniform. However, the short skirt and the really long and loose socks — those are another story.
Schools in Japan have been prescribing the military looking uniforms for boys and girls. As mentioned above, girls wear something that has a sailor collar and is known as the sailor fuku. Boys on the other hand wear military style uniform with high collars and they are called gakuran. This has been the prescribed uniform since the Meiji era. There is a new trend though, and that is the adoption of the more Western style of uniforms which would typically have the white dress shirt, necktie, blazer with the crest of the school. In the more Western style of uniforms, girls wear a tartan skirt and boys would have trousers which are not necessarily of the same color as the blazer.
If you see girls in short skirts, they do not necessarily wear it that way while inside the school premises. They might tuck it in by some magical way or skill so that it will appear to be short but while in the school premises, they have to make sure they adhere to the regulations. Hence the need to untuck the skirt somehow. The same thing goes for the socks. Loose socks are not prescribed but students insist on wearing them anyway.
This kind of fashion is popular among otaku outside Japan. There is the idea that it is cute and they even tailor their customized uniforms. The hip way that the students wear their uniforms is probably part of the way Japanese street fashion is and as such, one could surmise that it is why some of the young people all over the world are imitating this, especially those exposed to anime and games.