So I've been living in Japan and teaching in the schools for a number of years now and want to try and paint a picture of just how real some of the things you see in anime are, but I'll also mention that what I'm going to say is by no means a 100% be all and end all on the subject. I've certainly been to a lot of different schools, but it'd be impossible for me to make blanket statements covering everything. I'll try and hit on some of the big things you see pop up in a lot of anime.
Anime's representation of School Uniforms - Fact but with two disclaimers
When it comes to uniforms the vast, vast majority of JHS (Junior High Schools) and HS (High Schools) have them. There are some schools that don't require a uniform however. The interesting thing about this is, even though they don't require a uniform a good number of the students will still buy a uniform and wear it to the school from time to time. Uniforms are a pretty big deal. Since you first get them in JHS (only private elementary schools will require uniforms) it's a sign of growing up, also it's easy and a lot of students think they are cute. Believe it or not when a student is deciding on what high school they want to go to some might actually take into account what the uniform looks like.
Most JHS for girls have a uniform issue skirt, shirt and blazer (sometimes a vest as well). Most students however will not wear the blazer and instead opt for a sweater. White socks use to be the norm, but now you mainly see navy blue knee socks. For the boys it's pants, shirt, jacket and tie depending on type of uniform. In HS a decent number of schools only have a skirt that makes up the uniform leaving the shirt and other things like a tie, jacket and sweater up to the student. Schools with a more complete uniform will also likely have different ones for summer and winter. For boys it's more similar to JHS. As you've probably seen there are the uwabaki or slippers that students have to wear indoors. Yes they have to change their shoes before entering the school and change into their slippers. They also have different PE shoes for use in the gym. Students also do wear their uniforms outside of school a bit. Perhaps they might wear it to cram school or if they have weekend events at the school they will wear the uniform.
There are rules set up about how your suppose to wear the uniform, but like with most other things in Japanese schools the rules aren't really enforced. Because of this students will sometimes wear t-shirts, wrong color shirts, perhaps just regular street clothes and take other liberties with the uniform that they shouldn't. This could also include dying hair and piercings. Normally this is something that "yankee" students will do, but others will bend the rules a bit too for personal style. There is room for students to add their own flair, but there are limits they aren't suppose to cross. Also depending on the school (more for JHS) students will wear the PE uniform during the day instead of the regular uniform perhaps because it's more comfortable or cooler in the summer. Speaking of PE uniforms virtually all schools now don't have girls wearing the bikini bottom style PE uniform. Those were pretty much completely phased out... 15 years ago and even before then. PE swimsuits though look just like they do in anime.
The one area where most anime will tend to be a bit off about uniforms is the design and colors. A decent amount of the uniform designs you see in anime you probably won't see in real life, they just don't tend to be that flashy. They're more simple and basic in design and color. Pretty much navy blue, black and grey make up most of the colors you see and most students just wear a skirt or pants, white or blue shirt and a sweater. Anime goes a bit overboard on the style of the uniforms.
So in closing: Not much here to really be wrong about. Yup there are uniforms and you have to wear them, but they are more basic then anime makes them out to be and PE uniforms are your typical shorts and t-shirt.