Note: This concept should not be confused with the concept of cross-dressing; the act of dressing as a member of the opposite sex without actually becoming a member of that sex.
As its name implies, the concept of sex change refers to a being possessing a physical sex becoming a member of another sex of the same species. In reality, it is possible to undergo surgeries and treatments designed to change one's sex. People that undergo such procedures are referred to as transsexual and may be of the male-to-female or female-to-male variety.
In video games and other forms of fiction, sex change is usually depicted with a much more fantastic or sci-fi bent. While there are limitations in how far transsexual operations and treatments can go in the physical alteration of one's self, such limitations are not present in fiction and thus the process can be depicted in a much more complete, instantaneous manner. One of the most well-known subjects of sex change in fiction is the anime character Ranma Saotome of Ranma 1/2, who transforms from a boy into a girl when splashed with cold water and back again when splashed with warm water. Ranma and similar characters have been portrayed in a number of video games over the years.
Use in gameplay
To expand upon the above example, Ranma Saotome, the protagonist of Ranma 1/2, falls into a spring of cursed water, causing him to uncontrollably turn into a girl when splashed with cold water. The effect can be reversed with warm water. A near instantaneous transition, Ranma's male and female forms feature a noticeable difference in size and physical strength. Games based on the Ranma 1/2 property commonly allow the player to play as both forms.
Castlevania: Dawn of Sorrow
One of Soma Cruz's attainable soul abilities will temporarily turn him into a female Amazonian warrior.
In Crystalis, the player plays as a male protagonist who at one point must find a way to visit Aryllis, the queen of a village of amazons. Entry into her home is impossible until the player gains a spell that transforms the player character into a number of different forms, including a woman. Once the player talks to Aryllis while in female form, she will bestow the Bow of Moon to "her".
The original Baldur's Gate includes a cursed magic item referred to as the Girdle of Femininity/Masculinity. Disguised as a simple belt, the item is found very early on, and when adorned causes the player character's sex to switch to the opposite. Otherwise, the effect is harmless. It is included as the developer's way of teaching players the importance of properly identifying items before equipping them.
In the Darkstalkers series of fighting games, Demitri Maximoff has a special attack called Midnight Bliss. Part of the attack causes the opponent to undergo a temporary transformation. Any male affected is transformed into a (usually) sexually enticing woman.
The long-time Mortal Kombat antagonist Shang Tsung has the ability to morph into other fighters and use their moves. As such, any time he takes the form of a female fighter such as Sonya Blade or Kitana, he is temporarily changing his sex.
Use in cutscenes
Resident Evil: Dead Aim
The male main antagonist Morpheus, upon injecting himself with the TG Virus nearing the end of the game, will transform into a female B.O.W.
In the Blood series, there is a cultist named Gabriel who is killed at the beginning of the first game. When he is eventually brought back to life, he is resurrected as a female; a cruel joke that plays upon Gabriel's homosexuality. As a woman, he is known as Gabriella.
Use through customisation
Saints Row Series
The Boss, the player character of Saints Row 2, is the same character as the protagonist of the original Saints Row. The player is allowed to customize the character's appearance at the start of the game. However, while the player can customize the character as either male or female in Saints Row 2, the character creation system in the original game limited the player to strictly male design choices. In a sense, any game of Saints Row 2 started with a female protagonist has chosen to give the character a sex change. Additionally, the character creation system remains open after the main game has started, and the player can freely shift between male and female designs by visiting the proper locations. This same style of character creation carried over into Saints Row: The Third and Saints Row IV.
Dark Souls II
In the tutorial area of Dark Souls II, there is a nondescript coffin sitting on a shoreline and guarded by a pair of ogres. If the player character elects to enter this coffin, he/she will emerge from it as a member of the opposite sex.
Monster Hunter Series
While Monster Hunter Stories allows the player character to change their gender, age, voice and skin tone at will by visiting their house. Monster Hunter World only allows the player to do it once with a Free Character Edit Voucher but requires real money payment through microtransactions for further adjustments. Prior to this, players had to commit to a single character design and voice per save file which could lock them out of gender-specific costumes that could take hundreds of hours to acquire in another save.