Hold heading will keep you travelling in the direction you are pointed in for the most part. It works very well on flat terrain, but is not 100% foolprooof on side hills although it's better than having it off.
Hitting small hills at an angle, it will cause you to turn slightly to the downhill side, but will correct itself immediately once it's off the hill.
Once enabled, there is no need to touch it again during that mission. It doesn't turn off while controlling the vehicle mannually.
When in a gun position, it continues to work but any rudder action while turning the gun will also turn the vehicle. This is particularily difficult to avoid with twisty sticks.
Hope that helps. I use it all the time.