Regarding legality, it probably depends on where you live. I've heard of some places in the US having laws that make picking pretty much illegal. Whether or not they enforce these regularly, I don't know.
I personally have never had an issue in Montreal. I've had police see me, and they drive on by. I've had a few issues with rent-a-cops in rich neighbourhoods threatening to fine me, but it's never actually happened yet.
Sometimes people will ask you to leave their garbage alone. When they do this, I oblige (though in a couple cases I have gone back later when they're not around, I don't make a habit of it though). It sucks, but if you continue these people are likely to call the cops, who might then consider it to be trespassing. Most people choose to ignore you, and sometimes people will actually give you more stuff, which is sweet. One time, an old guy saw me picking through his trash and ended up giving me his old tobacco pipe collection (which I made around 100$ off).
I make sure not to make a mess when picking. Doing so is a bit of a dick move, and is also cause for you to receive a fine for littering.
Universities can be sweet, especially at the end of semester like you say. Just learn to look out for signs of bed bugs... there's a bit of info about this on my blog, under the "resources" tab.