It can be many things, try these steps, one of them will work for you.
1) The most likelly cause is a defective battery, replace the battery with a new one, and this will most likely fix the problem, but if it still doesn't work, try my other solutions.
2) It might be the Battery Connector, take out the battery and check if there is anything wrong with the connector.
3) Restore the OS, Connect your computer to desktop manager and click update.
4) Get a new Blackberry Housing Replacement, and replace it yourself; its easy and simple you just need to watch the youtube clip on the bottom of the page and its very explanitory.