First, I want to define target priority. It is essentially the order in which you shoot your guns and the order with which you target your opponent's units/tanks/models. Judicious target selection is a must in 40k. If you aren't careful, you waste a lot of shots on a single target or you don't put enough shots into another target. Our main goal is to be as efficient with shooting as possible. This ultimately is defined by the most damage with the least amount of shots.
Common pitfalls occur with new players. It just happens that way. Through experience, you learn how to prioritize your targets. To help you learn that lesson a bit more quickly, I will list a few mistakes most new players make.
1) Big, scary unit syndrome. When an opponent places a tough unit or tank on the table, it attracts a lot of attention usually because it projects a lot of threat. Thus, it is natural to want to eliminate the scary units. However, you can't focus so much on a single unit that you fail to address the MAJORITY of the your opponent's army. Example: Vulkan, some hammernators, and a land raider variant sound scary. They can take out most units in the game. They are resilient. They are roughly 1/3 of a 2,000pt army, maybe a bit more and can also only be in one place at a time. The other 2/3 benefit from their presence by allowing the focus to be on said unit. I am not advocating that you ignore this threat, but understand that it is one threat, not THE threat. Allocate to its appropriate place no your list of targets and systematically try to take care of it, but don't overdo it. You still have the rest of the army to think about too.
2) Incorrect application of shooting: low strength to higher AV. This mistake happens when a player tries to shoot a certain AV with a gun whose strength CAN penetrate, but probably WON'T. What do I mean? A missile launcher is a cost effective S8 shot against AV. If it shoots at the front armor of a predator, it can pen that predator on a 6. Good chances? Not really. This should only be done as a last resort or if you can torrent high strength shots into it. Your tac squad with a single missile launcher isn't going to reliably kill a predator, so shoot elsewhere until you can focus firepower on it.
3) Incorrect application of shooting: higher strength to lower AV (out of sequence). I added the "out of sequence" because this isn't always an improper use of firepower. It is when you have a lascannon to fire at a predator or chimera and you are using it to shoot at a speeder. Don't do that. Stay in sequence.
4) KILL IT, KILL IT GOOD!. This happens when you apply firepower to totally destroy a vehicle instead of making it useless. To further explain, if your opponent has 3 predators and you stun one immediately, you shouldn't continue to fire at it when there are two more predators. Since it is effectively neutralized for the next player turn, move on to another threat. Remember that shooting allows you a chance to neutralize threats. This doesn't mean destroy them. If you stun a tank, you have effectively negated its presence on the field until you next turn. You have a free turn with no input from that model. If that is the case, focus on another threat.
Those are just a few errors made by newer players. Here are some things to consider when prioritizing targets.
How many shots and strength values do I have access to?
How should I match strength to AV to most efficiently use that firepower?
Will moving to get side angles benefit my shooting?
Which threats are the most pressing?
What do I need to neutralize a threat for the immediate future (i.e. my opponent's turn)? Shake? Stun? Destroy?
What type of shot will have the most effect on each tank?
What if my shot fails to damage? How should I alter prioritization?
What do I do about targets of opportunity?
By considering these questions (not a definitive list by any means), you should begin to understand what you need to do. Eliminate the biggest threat (not most expensive unit) for the turn first and then work your way down the priority list. Start with your most effective guns and work to your less effective guns. By eliminating targets, you may just make your lower strength guns a more viable option.
Position models correctly. If I have a sternguard unit with two heavy flamers, they won't be able to pop a rhino in most cases, but if I can position them nearby and take the rhino out with a lascannon or meltagun, I can then use the flamers to barbeque the contents of the rhino. Remember that each phase of the game has a cause and effect relationship. Try to think a step ahead and remember that your army needs to work as a whole, not as individual parts operating on their own.
Exceptions to the rules:
1) Long shots- Occasionally, desperate times call for desperate measures. If you have a single missile launcher left to fire and it has no viable targets except a land raider, there is a small chance it can damage the LR. If that is your only option, take it. Don't waste firepower.
2) Using higher strength shots against lower AV in sequence. If your lascannon or meltagun have run out of high AV targets, feel free to shoot at the speeder. No problem.
3) Torrents of lower strength shots. You probably won't destroy a tank or unit this way, but you may cripple it to the point of it not being a viable part of the army anymore. 10 rapid firing bolters into the rear armor of a rhino could do a bit of damage with some luck and it is better than not shooting them at all.
It is important to notice that I am primarily using AV examples here, but the same principles can be used when discussing infantry models as well. Consider armor save, cover, torrent ability, and strength of shot in order to make the best decision.
In any game, I generally walk through a simple process. I decide which targets can hurt me the most. I then proceed to make them inoperable for at least the next player turn. If that means stunning a vehicle, good. If that means torrenting a unit to the point of destruction, good. I then match up the guns I think will bring me the most efficient form of success. If they don't, I sometimes alter plans if I think a unit is especially dangerous or in position to cause me trouble. Sometimes I move on and ignore the target further, hoping to do more damage elsewhere.
In the end, there isn't a true science to target prioritization. It is a fluid process that usually takes experience, planning, and a good bit of luck, but thinking it through beforehand means that you can have a more effective shooting phase and in turn unbalance your opponents' plans. This is a good thing.