If you are not using something like 'Caffiene', or some other 3rd-party tool to keep the MBP (Macbook Pro) actively running while it is closed, your MBP should enter stand-by within a minute or so, when the lid is closed to put into your backpack.
If the MBP is in 'stand-by', the HDD will not be spinning and is therefore very safe to transport. However, some software may, intentionally or unintentionally, keep your MBP from entering stand-by mode. If that happens, though, all hope is still not lost.
Looking at the specs for a typical 2.5", internal HDD these days yields the following:
Environmental (operating) Shock (half-sine wave) 400 G/2ms, 225 G/1ms
Environmental (non-operating) Shock (half-sine wave) 1000 G/1ms
The first thing to notice is that the limit is lower for a shorter impulse. This suggests that the drive is more sensitive to a sharp physical shock of short duration than to mild acceleration (typically < 1 G) as may be experienced on your daily commute.
If your backpack provides any padding, and you are careful to place your backpack on your floor, where it can't slide off the seat and hit the floor, it should be fine even if it is still running. But, if you are walking out and smack your backpack into a wall or doorframe on your way, the risk is much higher.
Even at the higher risk, though, the real risk is pretty low. Imagine the impact necessary to damage the drive while it is off. The shock it would take to damage it while running is still greater than 20% of the non-operating shock tolerance. That is a pretty significant shock.
For the record, I never power-off my MBP, but it DOES go into stand-by before I bag it.
I hope this helps!
@Synetech the OP said they close their macbook, by default that means the machine's suspended. – James T Snell – 2014-09-16T22:17:20.233
this depends though too, the only piece of hardware i would worry about is the Hard drive. If it's an SSD, then no problem, but if it's a platter and if you hit a large bump or something along the way and the computer decides to do something in the background, it could corrupt some data. Also, overheating is a possibility if leaving it in a backpack while it's on. I think putting it to sleep would help though. – Matt – 2011-09-22T05:56:53.107
2@Matt: if the computer is suspended, then the hard disk is certainly powered down and its heads are parked. – Joachim Sauer – 2011-09-22T06:32:33.453
@JoachimSauer except that the OP never said anything about suspending their MacBook, that was (probably incorrect) assumption that Doc made. In fact, the OP specifically asked about leaving their MacBook powered on. – Synetech – 2014-01-15T20:58:33.030
1To most people Closed = Suspended. You close the lid on a Macbook and the default operation is for it to suspend. By powered on, he is obviously talking about the opposite of taking the time to turn it off fully. – Michael Frank – 2014-01-16T04:44:41.677