The heater should be placed wherever you can place it. Read the directions carefully, because some heaters will malfunction (and at worst, explode) if placed on or under the gravel. Some should be placed horizontally, some vertically, and some will be fine in either direction. Also, all cylindrical-shaped heaters have a minimum water line that they must be submerged past. I agree that the thermometer should be as far away from the heater as possible to give you an accurate reading of the tank's minimum temperature.
Personally, I put my heater in the back filter compartment of my Fluval Spec, so I may not be too helpful compared to other members who have tanks without filter compartments.