I don't know from personal experience, but I've heard stories. Cops will give you a worst-case scenario, which involves big fines and maybe jail time, but that only happens if the cop who catches you is in a bad mood, the judge is a law-and-order type, and the guy who owns the property is a dick. I think that if you're not vandalizing, and you're just checking the place out, a cop would probably be inclined to just tell you to get lost. If he does, respect it; going back would just be a slap in the face to a police officer who did you a favor.
My friend Rookie has some friends who got caught at the old Ohio Penitentiary. He wasn't there; they had all explored the place and his friends returned to rappel from the water tower. They were whooping and yelling to each other and somebody called the police, who showed up and issued tickets and court summons to all but one of them (he escaped by way of the Pen's underground tunnels). From what Rookie said, his friends had to appear before a judge, but aside from that inconvenience, what happened to them was no worse than a speeding ticket. They had to pay a fine. Bear in mind that they were really flaunting the whole trespassing thing.
As I said, don't vandalize, and don't make a lot of noise. My friend Hoss likes to push the envelope (throwing rocks from rooftops and things like that), but at the same time he really knows what he's doing when it comes to not getting caught. There's a fine line.
Scouting -- It's not absolutely necessary, but a daytime reconnaissance trip can be very helpful. You don't even have to get out of the car. Look around to see what kinds of buildings are nearby. Houses where people will be all night, or businesses which empty after 5PM? Also, look for a way in. There's no better way to get caught than to be running around outside.
Parking -- Park somewhere safe, of course, where you won't be ticketed or towed, but also remember not to park anywhere where it'll be glaringly obvious that the people who belong to your car are inside the abandoned building. This is a major tip-off. Even if they don't catch everyone, they might tow you, and they'll certainly be able to trace the car's owner through the plates. So park on a street or in an all-night parking lot.
Flashlights -- Any kind of flashlight will do, but most people do like the Mag-Light. They feel good in your hand. Hoss has a 2 million candlepower boat light which we use sometimes to illuminate an entire room; you can feel the heat from fifty feet away. The most important thing to remember about flashlights in an abandoned building is to use them as little as possible. The windows of an abandoned building will almost never be boarded above the second floor or so, since most people can't throw a rock any higher. If you're high up in an abandoned building at night, any light you cast is very visible. Never, ever shine your flashlights at the windows. Doing this turns the place into a lighthouse. Local cops know what buildings are unoccupied, and if they see lights inside they'll come and get you.
Semi-Occupied Buildings -- Some buildings have an abandoned section. The first floor might be occupied by a flower shop, but the upstairs apartment hasn't had residents since 1965. Or an old high school's gymnasium might be rented out for events while the rest of it crumbles away. Places like this are a gray area. If you explore them, you're risking bigger penalties, since it can be asserted that you were trying to break into the occupied section. That's Breaking and Entering, a mid-level felony. The prisons are full of people who were breaking and entering. Still, it can be fun. Just be ultra-cautious. I only explore places like this with people I know can handle themselves, like my friends Hoss and Rookie. During my second trip to Americana Amusement Park, Hoss and I realized that there was a guard in the little hut up front. When he did his rounds, spotlighting the nooks and crannies of the park with a searchlight, my instinct was to run, but Hoss made me duck down behind the go-cart racecars and the guard just drove right by. Never panic.
Dangerous Buildings -- The only building I've been in which was really dangerous was the Rainsboro Theater. The floor on the first level was full of holes, and when I leaned against a wall on the second floor it actually fell over and bricks fell down around my head. Rookie told me about the ballroom at Idora Park, where he says you can't walk to the middle of the room without falling through the floor. Not too many buildings like this exist, but I'd advise you to walk slowly and make sure the floors are sturdy. Most people do this on instinct anyway.
Vandalism -- Some people break into abandoned buildings to spraypaint stuff on the walls. I don't choose to do this, but if you're doing it, I'd advise you to throw your cans down at any sign of trouble. And try not to get paint all over your index finger. If you want to break windows and stuff, remember that sound carries really far in the still of the night. And grow up at some point.