When I was at uni, I experienced both scenarios.
When I did my undergrad, I lived 10 mins away from my uni. By far I enjoyed that more - who wouldn't enjoy living close to uni? More time for everything.
When I did my masters, I had to travel using two trains and a bus with a one way commute of around 90 mins. That wasn't as fantastic. If you put that into perspective, that's a good 3 hours out of the day you've lost due to commuting.
At present for my work I travel 1 hour one-way approx and that alone squeezes and limits the time I have to do everything else. Productivity is by far less when you're travelling significant amounts. You could argue that being on PT allows you time to study/revise/etc. in preparation on the way there but this doesn't factor in peak hour PT services where you're forced to be sandwiched between people with no place to sit or even concentrate.
Depends on the person. I hated long commutes. Still do. If you have an opportunity to reduce the length of a commute, do it. You'll be better off for it long term.