Can I replace a 40A water heater breaker with a 60A breaker to prevent trips?
TLDR:  there aren't that many things that handle electricity in a water heater - a couple of switches (unlikely to be them) and a big heating element. None of these parts are expensive.  Why not just fix the heater?  I don't know how to fix a heater but I know how to change a breaker - that's an effect my father referred to as "rearranging deck chairs on the Titanic". And the cure is "school up". 

Never up-size breakers!

I don't understand how humans develop the logic "Breaker size X trips, let's just use breaker size X+10 or 20 and maybe it won't trip anymore". I guess it's because they don't know why breaker sizes are chosen in the first place. 

Breakers protect wires and appliances.  Without a correctly sized breaker,  the wire can overheat and start a fire.  Worse, it'll start it inside the walls, where it's impossible to put out a fire early - it will fully engage, there's nothing  you can do about it, and the house is done.  

Or the equipment can have an internal fault that isn't detected by the breaker.  Of course appliances are safety tested; that's what Underwriter's Laboratories does, and they apply UL listings.  But a UL listing is only good if you install the appliance properly, and that includes the correct breaker size - UL can't vouch for a 30A appliance on a 60A breaker! 



Obviously, the "up-size the breaker" mentality has already visited your house.  Almost all water heater circuits are 30A, and here you are already at 40A.  I suspect you've already had trip problems, you or the "last guy" has already up-sized the breaker, and that didn't work so here you are.  That is because the underlying problem is still there.  Your 60 will also trip, and you'll find yourself installing an 80, 100, 150, where does this end?   Why not just forget the breaker and go with this sub-feed lug kit? 



See? It contains no breaker at all, just lugs.  Put a known-defective large appliance on no circuit protection whatsoever - what could possibly go wrong? 

Well, a 60A breaker on a 30A large device and 30A wire is pretty much "no circuit protection whatsoever". 

Or is this a GFCI problem?

You may have a water heater which isn't burning down the wires, just has a ground fault and is tripping a GFCI breaker.   GFCIs aren't required on water heaters, so you could hypothetically replace the GFCI with a plain breaker of the correct size (30A).  Boy, I hope your supply pipe is metal... However, again this does nothing to fix the underlying problem.  

If it's a GFCI trip, the underlying problem is probably dirt/dust in the water heater wiring, or a faulty heating element.