Most RVs and campers are equipped with propane furnaces that usually do a pretty good job of keeping them warm enough on cool nights. Just set the thermostat and as long as you don't run out of propane or run your batteries down you will stay warm. Interestingly enough, when your batteries get low the furnace fan may keep running, blowing cold air. However, even with a good furnace, you may need extra help on really cold nights. Often Canadian motorhomes come from the factory ready for winter use, but most made in the United States do not. Usually you can make modifications to make them more suitable for cold weather camping if you need it but it can be expensive. You may need extra insulation along with freeze-proofing your water systems and increasing heat through a larger or additional heating unit.
Boats have different heating and cooling problems than RVs. Please see my post on Keeping Your Boat Cabin a Comfortable Temperature for more information on boats. Basically, you will only find heating and cooling systems on larger yachts and not on the daysailers typically used by weekend sailors. Fortunately, we don't often use our boats in freezing weather.
You might take advantage of all the warmth from sunlight you can get: park so the side with the most or largest windows is facing the sun most of the day. Solar heating won't keep your RV warm by itself but it can help keep it warmer.
One of the first things to do is to make sure you aren't throwing away heat through open windows or vents. Make sure you roof vent(s) are closed. It is easy to forget to close the one in the bathroom. Avoid opening exterior doors as much as possible. Also be sure to close curtains and drapes. Adding reflective foam insulation to windows can help keep you warmer in winter and cooler in summer. Some units may benefit from additional insulation. For example, it was easy for me to add a Styrofoam insulation panel to the roof of a van camper. All that was there before adding the insulation was a cardboard-like headliner. The foam helped keep it warmer in winter and cooler in summer. It usually isn't practical to add insulation to the walls, ceiling, or floor or most RVs and campers, unless you are already opening them up for other repairs or modifications. If you REALLY need extra insulation you might be able to install foam panels on the inside of the walls and put new paneling over it. You will loose a little space inside your unit but it might be worth it. The easiest way to do this is with Styrofoam insulation panels. Another alternative would be to essentially build an extra wall all the way around the inside of your unit to give you room to install residential-style fiberglass insulation. Doing it with 2x2 studs will probably double the thickness of most RV walls and insulation since most RVs have 2x2 studs in the original walls. To get full R-13 insulation like you have at home you might need to build new wall inside using 2x4 studs. Doing that will use up at least 5-6"of interior space for each wall, depending on what kind of wall board you use. One issue you will have to deal with in either case is the moldings around doors and windows, which may take some creative construction to achieve acceptable results. And don't forget the ceiling! Since heat rises, you want to make sure you aren't losing heat unnecessarily through the roof! Adding insulation to the floor will likely very intrusive and expensive. Sometimes you can reduce heat loss through floors by putting a skirt to block wind from blowing underneath the vehicle while it is parked. For long term usage, like using your motorhome or trailer as a guest house at home, you can use plywood or other rigid panels cut to fit between the bottom of the wall and the ground. If you want skirting during your outings, flexible panels made of vinyl or canvas will do the job. You usually need to install snaps along the bottom edge of your unit to secure flexible panels. Heavy duty Velcro might be an option if you don't want to drill holes in the walls of your RV.
Take advantage of every available resource to reduce heat loss. Close curtains and drapes. Close vents. If there is a breeze coming under a door, roll up a towel and lay it against the crack where the breeze is coming in. You might be losing heat under doors even if you don't feel any breeze coming in. If you can see daylight under the door, it probably needs to be blocked to reduce heat loss. Since heat rises, be sure to check for gaps at the top of exterior doors too. You may be able to add weather stripping to block gaps.
In most cases adding an auxiliary heater of some kind is the easiest and least expensive way of warming up a cold RV or camper. If you have 120 volt electrical power from a generator or shore line an electrical heater is really easy to install and use and is generally a little safer than propane heaters that consume oxygen. Even indoor rated catalytic propane heaters that do not produce significant amounts of toxic fumes will consume oxygen to you always have to provide adequate ventilation to prevent suffocation! You will want to take precautions with all heaters to ensure they are not too near to any combustible surface, such as curtains, drapes, upholstery, and bedding. Also be careful using them to dry wet shoes and clothing, making sure items aren't too close. Electric fireplaces are an attractive way to add heating capacity along with a nice cabin-like ambiance. The ones I've used fit nicely under the dinette table.
Sometimes you might simply add an extra sweater or sweatshirt or even a jacket or dress in thermal underwear to keep YOU warmer without having to heat the entire living space of your RV or camper. At night an extra blanket or quilt or a warmer sleeping bag might all that is needed. Some folks like to wear warmer "bunny" pajamas and socks but many people feel claustrophobic with too much clothing in bed. You will usually sleep best and most comfortably when dressed the way you usually sleep at home. You can add warm rocks or something like warmed potatoes or a hot water bottle to your bedding to help ward off cold feet, just make sure they aren't hot enough to scorch the bedding or hurt your feet.
If you do a lot of cold weather camping and your existing furnace isn't sufficient to keep you comfortable you may be able to add a second furnace or upgrade the existing one. Upgrading the existing one is usually easier and less expensive as it can take advantage of the original electrical and gas connections, fit in the old cabinet, and use the existing ducting. Many times newer, more efficient furnaces with greater heating capacity will fit in the space of older units but sometimes you may have to modify cabinets around them to make more room. Adding a second furnace usually requires additional wiring and gas plumbing plus venting to the outside as well as finding someplace to mount it. Some furnaces rely on convection to circulate the heat but others may require the installation of ducting so keep that in mind when choosing and installing your new furnace. Convection furnaces are often used in small units like slide-in campers; ducted furnaces are common in larger trailerl and motorhomes.
You might be able to improve the energy efficiency of your rig to make it easier to heat and to keep it warm. Try to eliminate any drafts around plumbing, wiring and doors. Minimize opening of doors. Keep curtain, shades, and drapes closed and add reflective foam panels to cover your windows. If you ever have access to the inside of walls, floors, and ceilings (such as during repairs or renovations) consider increasing the insulation. The gains from adding insulation probably don't warrant opening things up just to install it so take advantage of any time you do have things apart.
Monitor your propane usage closely. During cold weather you will use more gas for heating, cooking, and hot water. The last thing you want to do in cold weather is run out of heating fuel! For extended stays bring along an extra portable tank or two of propane and invest in an Extend-A-Stay system to attach them to the propane system on your RV. These work well for an auxillary gas supply for RV appliances but since RV generators run on liquid propane they won't work when the liquid in the RV tank drops below the pickup point. You might be able to hedge your bet for extended stays by connecting the auxillary tank long before the level in the permanent tank drops below the generator pickup.
If you have shore power or a big battery bank and an inverter you might use an electric blanket to keep you warm at night. There are even 12 volt electric blankets if you have enough battery reserve for it. If you rely on a generator or solar power for your electricity you still might use an electric blanket to pre-warm you bed so it is more comfortable when you get in it and it will stay warmer longer. You can then conserve energy by turning it off. You might need to turn it back on a time or two during colder nights. That might be a problem if you don't have enough battery reserve and rely on your generator and are camping where running it at night might disturb other nearby campers.
One rather extreme solution, is to purchase a different unit, one that was built for cold weather use. Many Canadian models come from the factory already suitable for cold weather operation, including freeze protection for the plumbing and sufficient furnace capacity. Some units manufactured in the United States can be purchased with winterization packages but most standard units will not be suitable for winter camping without additional modifications. To convert an existing RV for cold weather operation you will need to freeze protect the fresh water and waste water systems as well as improving insulation and upgrading the heating system.
Heat it up!