A protein folds into its native structure with the α-helix and∕or β-sheet in aqueous solution under the physiological condition. The relative content of these secondary structures largely varies from protein to protein. However, such structural variability is not exhibited in nonaqueous environment. For example, there is a strong trend that alcohol induces a protein to form α-helices, and many of the membrane proteins within the lipid bilayer consists of α-helices. Here we investigate the structural stability of proteins in aqueous and nonpolar environments using our recently developed free-energy function F = (Λ - TS)∕(k(B)T(0)) = Λ∕(k(B)T(0)) - S∕k(B) (T(0) = 298 K and the absolute temperature T is set at T(0)) which is based on statistical thermodynamics. Λ∕(k(B)T(0)) and S∕k(B) are the energetic and entropic components, respectively, and k(B) is Boltzmann's constant. A smaller value of the positive quantity, -S, represents higher efficiency of the backbone and side-chain packing promoted by the entropic effect arising from the translational displacement of solvent molecules or the CH(2), CH(3), and CH groups which constitute nonpolar chains of lipid molecules. As for Λ, in aqueous solution, a transition to a more compact structure of a protein accompanies the break of protein-solvent hydrogen bonds: As the number of donors and acceptors buried without protein intramolecular hydrogen bonding increases, Λ becomes higher. In nonpolar solvent, lower Λ simply implies more intramolecular hydrogen bonds formed. We find the following. The α-helix and β-sheet are advantageous with respect to -S as well as Λ and to be formed as much as possible. In aqueous solution, the solvent-entropy effect on the structural stability is so strong that the close packing of side chains is dominantly important, and the α-helix and β-sheet contents are judiciously adjusted to accomplish it. In nonpolar solvent, the solvent-entropy effect is substantially weaker than in aqueous solution. Λ is crucial and the α-helix is more stable than the β-sheet in terms of Λ, which develops a tendency that α-helices are exclusively chosen. For a membrane protein, α-helices are stabilized as fundamental structural units for the same reason, but their arrangement is performed through the entropic effect mentioned above.