Theranostic agents with fluorescence in the second near-infrared (NIR-II) window, especially in its long-wavelength region, and NIR-II-excitable photothermal effect is promising but challenging in tumor diagnosis and therapy. Here, we report a simple but effective strategy to develop semiconducting polymer nanoparticles-based theranostic agents (PBQ x NPs) and demonstrate their applications for long-wavelength NIR-II fluorescence imaging beyond 1400 nm and photothermal therapy (PTT) of tumors upon excitation at 1064 nm. Both experimental results and theory calculations show that the brightness and photothermal performance of PBQ x NPs can be simultaneously improved by simply increasing the repeating unit number of semiconducting polymers. For example, PBQ45 NPs have 5-fold higher brightness than PBQ5 NPs and 6.7-fold higher photothermal effect (based on PCE × ε) than PBQ3 NPs, and exhibit promising applications in long-wavelength NIR-II fluorescence abdomen imaging, image-guided tumor resection, and image-guided PTT. This study demonstrates the effectiveness and importance of repeating unit numbers in regulating the theranostic performance, which has not received enough attention before.