The Constitution of the United States gives Congress the power to enact laws relating to patents, in Article I, section 8, which reads "Congress shall have power . . . to promote the progress of science and useful arts, by securing for limited times to authors and inventors the exclusive right to their respective writings and discoveries."
Patent by Max Fleischer, artist unknown; cropped/retouched by Rl [Public domain], via Wikimedia Commons