A lot of areas that are good for hiking or backpacking are also popular hunting grounds. I am an avid backpacker and hiker, but I do not know much about hunting. How do I find out what is the hunting season in a particular area, and when backpacking during hunting season, how do I avoid getting shot?
The most important thing is to know what is being hunted so you can know how the hunters should be approaching their prey. It's best to talk to several hunters to find out from them where they will be concentrating, but it's hard to control for any random person with their own ideas about how they will be approaching their hunting. The vast majority of hunters are extremely safety conscious and will go out of their way to educate anyone who is curious about safety and sharing the outdoors.
Turkey season is generally horrible since hunters are so camouflaged and hidden whereas deer season is better with everyone lit up in blaze orange for visibility.
In your case, you probably don't really care if you are scaring off the game so wear vibrant colors, make a lot of noise and avoid heavy brush and areas with limited sight lines. Wide open areas with a clear view are safest. Noise is really your best tool since you also should be concerned about ricochet, misfires and target practice as well as intentionally placed shots where you happen to be directly behind the target.
Your local DNR (Department of Natural Resources) website (example) will have the hunting season.
I'd like to say all hunters are safe, but there's a reason I don't hunt public land. Also the biggest threat is poachers, who are going to ignore all of the above, as well as season, legality, etc.
In short - be sensible. Make yourself easily seen and heard, don't walk near somewhere you hear gunfire, and where possible stick to open areas on clear, marked paths.
Of course, I'd also question the wisdom of hiking somewhere when hunting is happening; if there's a sensible alternative that seems like the logical option.
In terms of where to look for information, look up the local authority's website and from there you can usually find the various times that you need. If you can't find it then find an official contact and send an email, they should guide you to the right place or be able to provide the information needed. Preparation in due course is key here.
On a related note, if you're talking about army training / live fire then stay out of the area entirely when this is going on - it'd be stupid (and most probably illegal) to stray into such an area. North Dartmoor in the UK for instance is an area where this happens, but the information on times is easily available online, it's clearly marked on maps and there are clear posts on the moors to indicate the boundary markers for these areas too.
Your main problem will be people deer hunting, or other large game, with a rifle. My first bit of advise would be to not even bother going out for the gun season.
The dangers with large game and gun season are that the prey is takin at a much larger distance, and more confusion could take place.
If you "have" to go out hiking during the gun season I would suggest wearing all blaze orange. Better safe then sorry.
As far as being out during small game or bird seasons. One article of blaze orange should be more then sufficient. Most people will be using a bow or shotgun which have a pretty limited range compared to a rifle and should be able to see you.
All the other advice about what to wear and where to stay is also very good advice.
Hunting seasons and licenses are an issue handled by the states in the US. So check the website of the state you want to backpack/hike in to find out about their various seasons.
Honestly, in most areas this isn't a problem because hunting has to be kept to private land. I live on the East Coast and there are plenty of public land, like the Appalachian Trail, that does not have hunting on it, even in season.
It is always the hunters responsibility to correctly identify their targets and handle their weapons safely.
That said, you can always help them out by making it clear your are a human as others have noted. Bright colours, standing in the open, and human noise are all good. Trying to hide in a bush and trick the hunter with deer calls is a bad idea. It's better that we know you are there and that will likely cause us to move on anyway.
I bow hunt on public land in New Zealand, frequently in the same areas as trampers (hikers) though I don't actually see them all that often. We do not have any particular seasons on deer here, though you'll obviously find increased activity around the roar.
Usually we are using the same tracks you are to access areas and then hunting out away from them in certain areas. Most game animals don't like humans so the closer you are to huts, well used tracks and other people the less likely you are to be around people actively hunting.
Mostly, treat hunters just like other people you see out.
The better we all get along together in the wild the safer we'll all be. Most of us like to stop and have a chat, though we're often wary of upsetting people as we know some are not comfortable with weapons around. If you're nervous ask a few polite questions, it's easy for us to show when rifles are unloaded, explain where we are and aren't shooting etc.
My only caution would be to leave weapons alone unless specifically given permissions to go near them, this particularly applies to curious children. Generally this shouldn't be a problem as hunters will be guarding them closely, but it comes up sometimes when we are sharing huts etc.
Have fun out there :)