Used to be that RAW, the sniper wasn't getting the sneak attack. Why? No good reason other than that "a legalistic reading of the rules said so." There are no end of huge threads on paizo.com going over in tortuous detail how vision and stealth and all that work in PF core, especially here and here, and the summary was "slavishly following the rules means things that make no sense." You never get sneak attack from stealth because "you can't stealth while attacking" and "it doesn't say you get sneak attack just because someone can't see you, as hidden isn't an official condition (tm)."
I would previously invoke GM privilege to implement RAI - as in Pathfinder they say clearly "the GM is the law over and above the written rules" - and make it so they get their sneak attack. Because it makes sense from a game world logic/sim point of view and you can rule that's more important than the RAW point of view. IMO the clear intent was to sneak-attack someone from Stealth. You know, "sneak," "attack," things that happen in the real world and every previous edition of D&D.
Can I Attack From Stealth?
Now, however, the Stealth rules have been errata'ed to specifically say "you can attack from stealth" which means that yes, you get the sneak attack. See the updated version on the PRD which says:
Breaking Stealth: When you start your turn using Stealth, you can leave cover or concealment and remain unobserved as long as you succeed at a Stealth check and end your turn in cover or concealment. Your Stealth immediately ends after you make an attack roll, whether or not the attack is successful (except when sniping as noted below).
Sniping: If you've already successfully used Stealth at least 10 feet from your target, you can make one ranged attack and then immediately use Stealth again. You take a –20 penalty on your Stealth check to maintain your obscured location.
So the RAW has been updated to match the RAI for whatever that's worth (apparently it's really meaningful to some, though all my rogues have been happily sneak attacking from Stealth since the year 2000...).
Does A Stealthed Attack Enable Sneak Attack?
Yes, if you're stealthed, your attacks are sneak attacks.
Jason Buhlman states the intent clearly on the Paizo forums:
For simplicities sake, it should be assumed that those making Perception checks get to do so at the most favorable point during the movement of a character using Stealth, to avoid making checks every time the condition changes. Technically, I think you would get a check whenever the conditions change, but that might make things overly complicated during play.
Creatures are denied their Dexterity bonus to AC "if they cannot react to a blow" (CR pg 179 under AC). It was our intent that if you are unaware of a threat, you cannot react to a blow. I think we probably should have spelled this out a wee bit clearer, but space in the Stealth description was extraordinarily tight and ever word was at a premium. That said, I think these changes clear up the situation immensely (compared to where they were.. which was nebulous at best).
They didn't bother changing the RAW because most people use common sense and play it that way. Stealthed = sneak, etc.
RAW + Pathfinder = Sad Panda
This is why, whether you like this or not, a pure RAW approach to Pathfinder is always going to be frustrating; the devs explicitly don't bother to clean up RAW when RAI and/or common sense is clear. It's not a priority of theirs and I for one am pretty happy about that - they spend their intellectual capital making new interesting fun content instead of crafting rules and just retreading the same content year after year like WotC did with 3.5 (Return to the Return to the 1e Module, anyone?).
According to the full-attack description on the d20 SRD:
If you get more than one attack per round because your base attack
bonus is high enough, because you fight with two weapons or a double
weapon or for some special reason you must use a full-round action to
get your additional attacks. You do not need to specify the targets of
your attacks ahead of time. You can see how the earlier attacks turn
out before assigning the later ones.
The fact that it specifies that you can decide who to target for each attack after the previous attacks have been resolved means that you can target different creatures with each attack. This also explicitly allows attacking a second creature if you've killed the first one.
Note that you must still use your attacks in order from highest-to-lowest attack bonus:
If you get multiple attacks because your base attack bonus is high
enough, you must make the attacks in order from highest bonus to
lowest. If you are using two weapons, you can strike with either
weapon first. If you are using a double weapon, you can strike with
either part of the weapon first.
Best Answer
There's a few different things going on here, so I'll go through them in order.
Standard Action Attack
If you use a standard action to attack, you get one attack at your highest base attack bonus. It doesn't matter how many weapons you are holding, or which hand they're in. You can pick the one you want to use for this attack.
Full Round Action Attack
If you use a full round action to attack, you can get extra attacks. Those extra attacks occur at BAB +6, +11, and +16 for a Fighter. Each extra one is -5 from the previous one.
So a level 6 fighter has 6/1, and on a full attack action gets two attacks. The first is using BAB +6, the second +1. At level 11, it would be +11/6/1. These are shown in the detail for each class in the Players Handbook, here is the Fighter one.
If you happen to be holding two weapons, you can use either, or both of them, for those two attacks. If our level 6 Fighter is holding a Shortsword and a Dagger, he gets to roll two attacks. He can do both with one weapon, or one with each weapon. This is not considered Two Weapon Fighting in the rules.
Full Round Attack with Two Weapon Fighting
In this case, you are explicitly using Two Weapon Fighting. You still get the attacks you would get for a full attack, except you need to pick a "main hand" weapon during the action and all those attacks use that weapon.
In addition, you get one additional attack at your highest base attack bonus, with your second weapon (the "off hand" weapon). All attacks in the round take a penalty, which depends on if you have the Two Weapon Fighting feat and the weapon category of your offhand. If you have the feat and a light weapon in your off hand, the penalty is -2.
You only get one offhand attack no matter what your BAB is. The feats Improved Two Weapon Fighting and Greater Two Weapon Fighting grant you additional off hand attacks.
So your example fighter with BAB +7/2 would on a full round attack get two attacks with his main hand, one attack with his off hand, and an additional attack with his off hand if he has the Improved Two Weapon fighting feat. Total of four attacks. Those attacks would be at BAB +5/0 and +5/0, due to the -2 penalty for two weapon fighting.
Note that characters, in the rules, do not have a "main hand" outside of this specific case. That means you don't always have to pick the same hand or the same weapon to use as your "main hand".
Natural Weapons
You didn't ask this specifically, but to avoid confusing you later - natural weapons (claws, bites, and such) don't work the same way. Those do not get additional attacks from BAB. Monsters as they get more powerful just get more natural attacks, and they can use all of them at once with a full round attack.
The monster's attack entry in the Monster Manual or SRD has these things factored in already, so if you follow those you will be fine. :)
Yes, it slows things down
Two weapon fighters (like Rogues) can very quickly get to several attacks, and that means a lot of rolling. It does slow things down. Once you understand how it works it slows things down less than when it's new, but it can make combat slow. If you hit with those rolls you'll also get multiple damage rolls to work out as well. If you have different colors of dice, you can roll all the attacks (and damage) simultaneously, which can make it move a bit faster.
It's useful for the DM to know the armor class of the enemy being attacked, so when the fighter rolls you know quickly if it's a hit or not. For the fighter, his character sheet should list his multiple attacks with the math for their rolls already done, so he can just look at his sheet and know "oh my second attack is at +3" rather than having to do the math every time.
It's also worth noting that those attacks don't have to be against the same target. If you kill something with your first attack in a full attack and another enemy is in range, you can switch to attacking that enemy with your remaining attacks. You can't move to do that, so they have to already be in range.