Ammonia is a major water quality factor influencing the survival and health of shrimp, among which the gill is the main effector organ for ammonia toxicity. In this study, we chose two types of Litopenaeus vannamei that were cultured in 30‰ seawater and domesticated in 3‰ low salinity, respectively, and then separately subjected to ammonia stress for 14 days under seawater and low-salinity conditions, of which the 3‰ low salinity-cultured shrimp were domesticated from the shrimp cultured in 30‰ seawater after 27 days of gradual salinity desalination. In detail, this study included four groups, namely the SC group (ammonia-N 0 mg/L, salinity 30‰), SAN group (ammonia-N 10 mg/L, salinity 30‰), LC group (ammonia-N 0 mg/L, salinity 3‰), and LAN group (ammonia-N 10 mg/L, salinity 3‰). The ammonia stress lasted for 14 days, and then the changes in the morphological structure and physiological function of the gills were explored. The results show that ammonia stress caused the severe contraction of gill filaments and the deformation or even rupture of gill vessels. Biochemical indicators of oxidative stress, including LPO and MDA contents, as well as T-AOC and GST activities, were increased in the SAN and LAN groups, while the activities of CAT and POD and the mRNA expression levels of antioxidant-related genes (nrf2, cat, gpx, hsp70, and trx) were decreased. In addition, the mRNA expression levels of the genes involved in ER stress (ire1 and xbp1), apoptosis (casp-3, casp-9, and jnk), detoxification (gst, ugt, and sult), glucose metabolism (pdh, hk, pk, and ldh), and the tricarboxylic acid cycle (mdh, cs, idh, and odh) were decreased in the SAN and LAN groups; the levels of electron-transport chain-related genes (ndh, cco, and coi), and the bip and sdh genes were decreased in the SAN group but increased in the LAN group; and the level of the ATPase gene was decreased but the cytc gene was increased in the SAN and LAN groups. The mRNA expression levels of osmotic regulation-related genes (nka-β, ca, aqp and clc) were decreased in the SAN group, while the level of the ca gene was increased in the LAN group; the nka-α gene was decreased in both two groups. The results demonstrate that ammonia stress could influence the physiological homeostasis of the shrimp gills, possibly by damaging the tissue morphology, and affecting the redox, ER function, apoptosis, detoxification, energy metabolism, and osmoregulation.