Here, we report the synthesis and characterization of size-controllable and stimuli-responsive DNA nanohydrogels as effective targeted gene delivery vectors. DNA nanohydrogels were created through a self-assembly process using three kinds of building units, respectively termed Y-shaped monomer A with three sticky ends (YMA), Y-shaped monomer B with one sticky end (YMB), and DNA linker (LK) with two sticky ends. Hybridization at the sticky ends of monomers and LK leads to nanohydrogel formation. DNA nanohydrogels are size-controllable by varying the ratio of YMA to YMB. By incorporating different functional elements, such as aptamers, disulfide linkages, and therapeutic genes into different building units, the synthesized aptamer-based nanohydrogels (Y-gel-Apt) can be used for targeted and stimuli-responsive gene therapy. Y-gel-Apt strongly inhibited cell proliferation and migration in target A549 cells, but not in control cells. By taking advantage of facile modular design and assembly, efficient cellular uptake, and superior biocompatibility, this Y-gel-Apt holds great promise as a candidate for targeted gene or drug delivery and cancer therapy.