Sometimes we wash with a cup, sometimes not; sometimes we wash twice, sometimes thrice; and not everyone agrees on method or pattern in all cases. Who says which ways we are supposed to wash, in which situations, and why?
Maran writes (Shulhan Arukh 4:1) that one shall wash his hands in the morning and make the Berakha "Al Netilat Yadayim." The Rama writes (ibid.) that one that did not use the restroom recites the Berakha of "Asher Yasar" anyways. However, we do not follow this Pesaq, because Rabenu HaAri writes (Sha'ar HaKawanot pg. 2) that one does not make a Berakha if he did not use the restroom (and the Rashash also writes so). Maran continues (ibid.) that waters that are unusable for washing for a meal are permitted for Netilat Yadayim in the morning, however some one doesn't bless upon them.
The Halakha Berura brings down five opinions as to the reason one washes their hands in the morning (however the answer of the Ari HaQadosh is not written in Halakha Berura): Introduction- The Gemara writes (Berakhot 60b) that one makes the Berakha "Barukh Ata A-donai E-lohenu Melekh HaOlam Asher Qideshanu Miswotaw WeSiwanu Al Netilat Yadayim."
There is an authoritative article at http://rabbikaganoff.com/archives/376.
Washing in the morning. Three times on alternate hands. To take away the “rouach ro'o” OC Siman 4 and especially seif 2.
Washing for davenning. It seems to need three times on alternate hands. OC 92 (4)
Washing for bread see question already answered: What is the source of netilat yadayim before eating bread? It can be done with one pouring on each hand (if using around at least 150 mls (Chazon Ish) of water each time) or with two.
For the custom in your community, CYLOR
MB 4 (2)  mentions the custom of washing 4 times to remove the “rouach ro'o”.
Sources: Mishnah Yadayim, Chullin 106a, Chagigah 18b, Shabbos 14b
There are, of course, two reasons to wash hands. One is physical cleanliness the other is for Taharah. I think physical cleanliness is understood. Hands need to be completely physically clean before washing them for Taharah.
Originally, DeOraisah, there was no specific Tumah of the hands. If something made a person Tamei then their whole body was Tamei. The Sanhedrin decreed that hands could become Tamei derabbanan under certain circumstances. The first such decrees came in the time of King Solomon and were expanded by the Sanhedrin over time. These decrees were made so that people should be careful about touching certain things such as Torah scrolls or other holy writings or Terumah. Later this was expanded even to touching Chullin (as a precaution for Terumah) so that today we need to wash before eating bread. Tumah of the hands also occurs if we touch certain parts of our body that are normally covered. It is possible that while a person sleeps this may happen or if a person is not paying attention this may happen so that we need to wash hands before doing certain things such as saying a berachah or praying or learning Torah. There is also an additional decree that water that touches hands that are Tamei can make other things Tamei. That is Tamei hands are Tamei in the second degree but water that touches them becomes Tamei derabbanan in the first degree. Today we only continue to do this as a takanah since everyone has a status of second degree Tumah out of doubt anyway.
For washing the hands to be effective in terms of Taharah it must be done in one of two ways. One way is to put your (physically clean) hands once into a valid mikvah at least up to the wrists. This can be done with both at once or with either hand first so long as the Tamei hand doesn't touch the Tahor hand in between. For example, if you dipped your right hand into the Mikvah, took it out and then touched it with the still Tamei left hand then the right hand would become Tamei again so it would have to be dipped again.
The other way is to pour water water from a vessel over them. The vessel has to be a complete unbroken vessel of at least a certain size. Each hand needs to be washed at least twice. Once to purify the hand and then a second time to purify the water on the hands (because of the decree that such water becomes Tamei). The first washing must be exactly up to the wrist. If it doesn't go up to the wrist it doesn't purify the hand. If the water from the first washing touches any part of the body above the wrist it makes the body (including the hand) Tamei again. If the Tahor hand is touched by a Tamei hand or by Tamei water then it becomes Tamei again.
To prevent these problems and make sure the hands are properly purified various customs and practices of hand washing were instituted. Some people also have the custom to wash even more than two times.
In practice today we wash before eating bread or upon waking up from a sleep of at least half an hour. One should also wash hands before learning Torah, praying or saying a berachah unless one has had his attention on his hands to make sure they have remained clean.