Does a book falling from a shelf have gravitational energy?

Yes; while on the shelf it has potential energy due to gravity of mgh where m = mass and g =gravity acceleration and h is height fom floor.

As it falls its potential energy is converted to kinetic energy mv squared/2 where v = velocity