The Gemara (Menahot 37a) explains that the Tefilin Shel Yad should be placed on one’s weaker hand, which in the majority of the population is the left side. This is learned from the word “Yadecha” (lit. “your hand”) in the Torah portion dealing with Tefilin, which can be separated and read as “Yad Keha”, or weak hand. Similarly, a lefty’s weaker side is the right side and that is where such a person would place the Tefilin Shel Yad.
The Shulhan Aruch (O.H. 27:6) rules like the Gemara and adds that one who is ambidextrous should place the Tefilin on the left arm. It then goes on to discuss a case in which a person writes with one hand but does all other activities with the other hand and gives two different opinions. The first opinion maintains that the weaker hand in this case is the one is used for writing since the one that does all other actions is considered stronger. The second opinion says that the hand that is used to write is considered stronger, especially since it says “Uchtavtam” (lit. “you shall write them”) in the portion dealing with Tefilin, and therefore the Tefilin should be placed on the opposite arm. There is a principle that when the Shulhan Aruch gives two opinions that begin with “Yesh Omrim” (lit. “there are those who say”), the Halacha follows the second opinion. Therefore, if one writes with one’s left hand for example, but does everything else with one’s right hand, one would place the Tefilin Shel Yad on one’s right arm.
The Kaf HaHaim (O.H. 27:31) and others, on the other hand, say that according to Kabbalah, the left hand is always considered weaker and thus the Tefilin should be placed on that side. Since there is disagreement in the matter, they say that one should first place the Tefilin on the left side and then after praying one should place it on the right arm, to fulfil all opinions. Nevertheless, in many instances the rabbis of the Maghreb tend to follow the straightforward understanding of the Halacha when in conflict with certain Kabbalistic approaches. Indeed Rabbi Moshe Kalfon HaKohen (Sho’el Venish’al) of Djerba, Tunisia says that one should place the Tefilin Shel Yad on the arm opposite of the side with which one writes.
That being said, if one writes with one hand and uses the other hand for other actions, it is proper to still place the Tefilin on the writing hand (in this case, the stronger hand) after one finishes praying with the Tefilin on the weaker side. According to the Ben Ish Hai Parashat Haye Sarah), one woul dneed two pairs of Tefilin Shel Yad because he posits that the Tefilin must be inserted on one’s arm in the proper position such that the letter Yud is pointing to one’s heart. Nonetheless, the Biur Halacha (O.H. 27:6, sv. “Ve’iter Yad Yemino”) and Rabbi Ben Zion Abba Shaul (Or LeZion, vol. II, ch. 3, § 3) say that one may take the Tefilin Shel Yad and simply flip it in the other direction so that it fits on the opposite arm.
Summary: A right-handed person places the Tefilin Shel Yad on one’s left arm and a left-handed person on the right arm. An ambidextrous person places the Tefilin on the left arm. For someone who writes with one’s left hand but uses one’s right hand for all other actions, one should place the Tefilin Shel Yad on the right arm. For someone who writes with one’s right hand and uses one’s left hand for all other actions, one should place the Tefilin Shel Yad on the left arm. In either of these cases, it is recommended, although not obligatory, to place the Tefilin Shel Yad on the opposite arm as well after one prays so as to fulfil all opinions.