Modern digital cameras tend to have very good long lasting batteries. However, if you are out somewhere special all day taking photos, you don't want the camera battery to die just as it comes to the beautiful light of sunset.
So here are a few ways you can make your existing battery last longer, as well as options you can purchase for longer lasting power.
Making an existing battery last longer
The LCD screen on the back of the camera is the biggest drain on the battery. Most cameras come with instant review turned on, this is where every time you take a photo it pops up for a second or so on the rear LCD. By turning this off you can save quite a bit of power. Try to avoid using the rear LCD as much as possible if you want to conserve battery power.
If your camera has an electronic viewfinder (EVF), use this instead of the rear LCD. EVFs have a lower power draw than the larger LCD screen.
It might sound obvious, but turn the camera off when you are not using it.
When using your camera's onboard flash (as opposed to external flash units that use batteries), reduce the power of the flash as much as possible. This can be done by using a high ISO and a large aperture (e.g. f/2.8). This reduces the amount of light needed for a good exposure, so the flash won't have to contribute as much light to the exposure. And only use the flash when you really need to.
Long exposures can really drain your camera's battery, particularly if you have long exposure noise reduction turned on. Long exposure noise reduction is where the camera takes the photo then immediately after takes another photo with an equal duration but with the shutter closed. This is then used in a process known as Dark Frame Subtraction to remove image noise. So a photo with a shutter speed of 30s would take 60s with Long exposure noise reduction turned on.
If you want to take long exposures while maximizing battery life, then turn Long exposure noise reduction off. Otherwise avoid taking long exposures, and use the ISO and aperture controls to reduce the time needed for a properly exposed photo.
In cold conditions keep batteries (and the camera if you can) warm. Batteries loose power much faster if they are used when they are cold. By keeping the battery in your pocket when not in use you can ensure it is not too cold and will operate more efficiently when you put it in the camera.
Make sure the battery is fully charged before use. Batteries tend to loose charge slowly over time, so if you haven't used your camera in a while the battery might not be quite fully charged. Virtually every digital camera today uses Lithium Ion (Li-ion) batteries. These have no memory effect, so even if the battery is nearly fully charged, it doesn't hurt to put it in the charger again just to make sure it's topped up.
More ways to keep your camera powered
As well as, or instead of trying to extend the life of your existing battery, you could purchase an extra battery for your camera. Different models of camera use different batteries, so make sure you purchase a battery that is compatible with your camera.
Batteries produced by the manufacturer of your camera are the safest in terms of compatibility and quality. If you are looking at purchasing a cheaper third party battery for your camera, check Amazon to see if there are any user reviews to give you an idea on the quality of the battery. Some third party batteries are badly made and can loose their charge quickly, or in some cases, even set on fire. Others are just as good as the originals, but much cheaper.
For some camera models you may also be able to purchase larger capacity batteries. Check the mAh (milliampere-hour) rating for the battery. The larger the number, the longer the battery should last.
For DSLR cameras a battery grip is often available. Depending on the camera model, this inserts into the battery slot on the camera and can take two of the camera's standard batteries, or attaches to the bottom of the camera and takes one battery (in addition to the battery already in the camera). Battery grips can also be used with AA batteries instead. They also offer a better grip and make holding and controlling the camera easier in portrait orientation.
Nikon MB-D15 battery grip
By using two batteries a grip can greatly increase the time it takes until the camera runs out of power. Depending on the product, the grip may come with the additional battery, or you may need to purchase it separately. AA batteries won't last as long as a normal battery, but can provide some convenience if you have a stock with you for your other devices.
If you are traveling around with a car, you can buy versions of most popular camera battery chargers that can plug into the cigarette lighter. This provides a convenient way of charging your camera battery when moving between locations.