A heater under the gravel is a big no-no. It will get overheated and will in the worst case fry your fish.
I just keep mine in the back corner behind a big plant. Be sure to check whether your heater is a fully submersible one or if it needs to have the top above water.
I have a submersible Visi-Therm heater, which I love. It's mounted with
the suction cups against the back, with the control knob know barely sticking out of the
water. It's right next to my Penguin BioWheel filter so that there is some water
circulation around the heater to better disperse heat throughout tank.
I have mine at the back behind a bit of wood with java fern. Can still see it though but I don't like to have anything plantlike to close to it incase it burns them and my farlowella catfish seems more inclined to attatch to it if it's behind wood.
As long as it's placed at a diagonal and has space I think it should be ok whatever.