Will iPhone 4 turn on automatically when charging? If my iPhone 4 dies, will it turn back on automatically after I put it on charge?

The reason I ask this is my lock button is broken and I'm afraid to let my phone die. What should I do?
Yes, it will turn on once it reaches the minimum charge needed to start the phone.

When the battery is completely drained, you would just see a depleted battery icon (with a connect to charger prompt) for a few seconds if you press the Sleep/Wake button or the Home button. Once you connect it to the charger, it will charge for a few minutes and automatically start up, taking you to the lock screen.

At any time, you can wake your phone by pressing either the Sleep/Wake button (on top) or the Home button (below the touchscreen).