They are called Rube Goldberg Machines.
Reuben Garret Lucius Goldberg (July 4, 1883 - December 7, 1970) was an American cartoonist who received a 1948 Pulitzer Prize for his political cartooning. He is best known for his series of popular cartoons depicting Rube Goldberg machines, complex devices that perform simple tasks in indirect, convoluted ways.