It's different for each generation.
Gen 1 and 2
In the Generation I and II core series games, Western language games (English, French, German, Italian, Spanish) can all trade with each other without issue. Attempting to trade between Japanese and non-Japanese Generation I and II core series games causes corruption of both save files.
In these games, a Pokémon is determined to be nicknamed if its name matches its species name. As a result, if an unnicknamed Pokémon is traded to a game in a different language where the Pokémon's species has a different name, its name will be treated as nickname. For example, in an English Generation I or II game, a foreign Pichu named "PICHU" will evolve into a Pikachu nicknamed "PIKACHU", but a foreign Charmander named "SALAMECHE" will retain the name "SALAMECHE" after evolving into a Charmeleon as if it were a nickname. Because these games do not track language of origin, if a traded Pokémon from Generation I or II is sent to the Pokémon Bank via the Poké Transporter, its language of origin is determined based on the game from which the Pokémon is transferred, not the game from which it originally came.
Gen 3
In Generation III (except in v1.0 of English Pokémon Ruby and Sapphire), if a Pokémon originates from a different language to the current game, when it evolves its name will not be changed, with the old name treated as a nickname; thus, if a Pichu named "PICHU" from an Italian game is evolved in an English game, when it evolves it will be a Pikachu nicknamed "PICHU". In v1.0 of English Pokémon Ruby and Sapphire, like in the Generation I and II games, if a Pokémon's current name is the same as its species name in the language of the game in which it was evolved, it will be treated as unnicknamed, so its species name will change upon evolution.
Gen 4
If an unnicknamed Pokémon evolves, its name is changed to the name of its species after evolution in its current game's language (regardless of its language of origin). In these games, there is a separate flag to indicate whether a Pokémon is nicknamed.
Gens 4-7
From Generation IV to VII, if an unnicknamed Pokémon evolves or a Pokémon hatches without being given a nickname, its name becomes the name of its species in its current game's language (regardless of its language of origin). For example, a French Bulbasaur without a nickname that evolves in an English-language game will evolve into an Ivysaur named "Ivysaur", but will still be flagged as a French-language Pokémon and will unlock the corresponding foreign Pokédex entries for Ivysaur and Venusaur as it evolves.
Gen 8
In Generation VIII, if an unnicknamed Pokémon evolves, its name will change to that of the evolved form in its language of origin. For example, a French Bulbasaur without a nickname that evolves in an English-language game will evolve into an Ivysaur named "Herbizarre".
Source: too much experience and Bulbapedia