You can find upgrades during some missions. Search everywhere and anything pops up in your hud investigate it. An upgrade found in a mission must be researched with gathered material, however.
You can also buy upgrades from varying vendors on the major hub worlds. Upgrades purchased from vendors are automatically applied. You can chat to the person next to the vendor and with a little persuasion/intimidation get a discount on all the vendor items.
You can also get upgrades by talking to your party members, each person suggests either an upgrade for the ship, an weapon/power upgrade, or a weapon.
To max out a weapon, however, you need to do ALL of them. There is a flat number of upgrades for each weapon. You will have to buy 2~3 of them depending on the weapon. The rest you find on missions and will have to use minerals for. As long as you do all the side missions and loot all money sources on the mission you do. You should have plenty to run up an upgrade tree or two.
(Unless you imported a game from ME1, however, you will NOT have enough money to buy everything in your first playthrough. Prioritize the upgrades to what you use first, health/shield upgrades second, collectibles like model ships and pets last.)
Acquiring any upgrade applies to all weapons/powers of the class unless the upgrade explicitly says otherwise. (IE Jack's bioptic boost suggestion only applies to Jack, and it says that in its text.) Allies do benefit from upgrades you pick-up, so don't forget to keep them in mind while you are shopping.
Note: You never buy weapons flat out, you either find them or pay minerals for them. There are also no more than 8 weapons in each category and they are spread VERY far apart game wise. You can buy individual armor components for Sheppard only, you can head up to your cabin to chose which components you are wearing.