Unless you are living in a highly secure apartment complex (which is usually pretty expensive), most apartments are only protected by the door lock and maybe an entrance gate.
Dorms, however, usually require special key-card access in addition to a door key and are monitored at night by the RA. College campuses often have blue-light security phones around campus and have surveillance by a campus security patrol and/or video cameras. Many schools also provide night shuttles to dorms and escorts for students upon request.