This is a wonderful question! To understand why things float you have to consider two things: 1) what is pushing "up" and 2) what is pushing "down"? The "down" force is easy - this is the boat being heavy that you mention in your question. So heavy boats are getting pushed into the water with a lot of force (by gravity)! So why don't they sink?
The "up" force: If you take a plastic ball and try to push it under water it can be quite hard because even if you can't see it, you are raising the level of the entire pool by a small amount. So you are actually pushing water up which is hard to do because water is also "heavy". So here is the answer to your question: boats float because when gravity tries to pull them into the water, it also has to push a lot of water up (the amount of water that has to move to let the boat in) so even though boats are heavy, they are also very big. If you had a boat that weighed the same as one that could float, but it was the size of a pebble it would clearly sink.
This idea that the size of the boat makes it less "heavy" in water is referred to as "density". Heavy boats float because they are less heavy than the amount of water they push away when they start to sink.
I hope this helps!