The Gemara in Masechet Shabbat (51b) establishes that it is forbidden to crush ice or snow on Shabbat. The Rishonim (Medieval Talmud scholars) offer different views as to the reason for this prohibition. Rashi (Rabbi Shelomo Ben Yishak of Troyes, France, 1040-1104) comments that since one creates water by crushing ice or snow, it resembles a Melacha (activity forbidden on Shabbat) and is thus prohibited. The Sefer Ha’teruma (Rav Yishak Ben Baruch, Germany, 12th century) claims that crushing ice constitutes "Nolad," as it entails changing an object into something else (ice into water). A different view was taken by the Rambam (Rabbi Moshe Maimonides, Spain-Egypt, 1135-1204), who claimed that the Sages forbade crushing ice or snow as a safeguard against the Torah prohibition of Sehita (crushing fruits for their liquid). If it were permissible to crush snow or ice, people might also crush grapes and olives for their juices, which would violate a Torah prohibition.
According to all opinions, this prohibition applies only Mi’de’rabbanan – on the level of Rabbinic enactment – and is not a Torah prohibition.
The Shulhan Aruch codifies this prohibition (Orah Haim 320), but adds that it is permissible to place ice in a cup, even if there is liquid in the cup, despite the fact that this will cause it to dissolve. Likewise, the Shulhan Aruch writes, it is permissible to place a cup of ice in the sun, even though this causes it to dissolve. (The Mishna Berura clarifies that this is permissible even "Le’chatehila" – optimally.) According to the Shulhan Aruch, then, the prohibition applies only to actively dissolving the ice ("Be’yadayim"); it is permissible to place ice in a situation which causes it to dissolve, as long as one does not actively dissolve it. The Shulhan Aruch evidently did not accept the view that crushing ice is forbidden because of "Nolad," for if this were the reason, then it would, conceivably, be forbidden to cause ice to dissolve even indirectly. The Shulhan Aruch seems to have followed one of the other reasons, and thus restricted the prohibition to active dissolution.
Accordingly, it would be forbidden on Shabbat to crush ice with a shaker, or by stirring ice with a straw or utensil. However, it is permissible to place ice in a drink, as this causes it to dissolve indirectly. The Kaf Ha’haim (Rav Yaakob Haim Sofer, Baghdad-Israel, 1870-1939), in Se’if Katan 60, writes that it is also permissible to shake one’s cup to dissolve the ice.
The question arises whether one who wishes to add ice to his drink must place the ice into the beverage, or if he may even place the ice into an empty cup and the pour the beverage over it. One could argue that by pouring a beverage onto ice, one directly causes it to dissolve, and this should thus be forbidden just like crushing ice. I consulted on this matter with Rabbi Bitton (of Yalkut Yosef publications), and he told me that indeed, one should preferably be stringent in this regard and not pour a beverage over ice cubes. In a case where one had a drink with ice, and some ice remains in his cup and he wants to pour another drink, he should pour the beverage onto the sides of the cup and have it fall down onto the ice, rather than pour on the ice directly. This way he avoids the possibility of violating Halacha by directly dissolving the ice.
Summary: It is permissible to place ice in one’s drink on Shabbat, or to put ice in a place where it will naturally dissolve, but one may not crush ice or stir it so it will dissolve. It is permissible to shake one’s glass to accelerate the ice’s dissolution. If one wishes to pour a beverage over ice that is already in his glass, he should preferably pour the beverage onto the sides of the cup, rather than pour it over the ice directly.