Welcome to the support community.
What version of the iBook do you own? Is it a 14" or 12" G4 model?
When you power it on, how long before it switches off? Also check to see what light is on your power adapter while plug in when this happens?
It could be a problem with the power adapter or your DC in board, but we would need further information in order to assist you.