As temperature and salt-resistant materials, hydrophobically associating polymers can form a reversible spatial network structure through the interaction between their hydrophobic groups, effectively improve the viscosity of the polymer solution through association, and enhance the temperature and salt resistance of the polymer. Hydrophobically associating monomers have different effects on the properties of polymer solutions. Herein, acrylic acid, acrylamide, and 2-acrylamido-2-methylpropanesulfonic acid were used as hydrophilic monomers. The three hydrophobic monomers with different carbon chain lengths were prepared by the bromination reaction. Hydrophobic associating polymers DQM1-PAM, DQM2-PAM, and DQM3-PAM were prepared by aqueous solution free-radical polymerization. The structure–activity relationship of the hydrophobic monomers with different carbon chain lengths on polymers was studied. It was confirmed by Fourier-transform infrared spectroscopy and 1H-NMR that the target product was successfully synthesized. Scanning electron microscopy revealed that with increasing hydrophobic carbon chain length, the hydrophobic microarea of molecular aggregation increased, forming a closer spatial network structure. Thermogravimetric and fluorescence tests revealed that with increasing hydrophobic carbon chain length of polymer molecules, the polymerization temperature resistance increased, intermolecular association degree increased, and critical association concentration decreased. Rheological property evaluation revealed that the viscosity of 0.5% polymer DQM1-PAM, DQM2-PAM, and DQM3-PAM was 71.32, 118.79, and 118.79 mPa·s after shearing at 120°C and 170 s− 1 for 1 h. With the increase in the carbon chain length, the retention rate of shear viscosity of polymer in a salt solution increased, showing good salt resistance. Concurrently, the molecular aggregation microarea of a solution with 0.5% polymer, degree of molecular chain action, viscoelasticity of the solution (G' > G''), and thixotropic area all increased. The performance of polymer solution can be improved by modifying hydrophobically associating polymers with long carbon chains, which has a broader application.