This is The Invisible Boy (1957).
It did indeed feature Robby the Robot, which appeared in several other sci-fi properties, including Forbidden Planet and Lost in Space.
The Invisible Boy (aka S.O.S Spaceship) is a 1957 black and white American science fiction film from Metro-Goldwyn Mayer, produced by Nicholas Nayfack, directed by Herman Hoffman, and starring Richard Eyer and Philip Abbott. It is the second film appearance of Robby the Robot, the science fiction character who "stole the show" in Forbidden Planet (1956), also released by Metro-Goldwyn-Mayer. According to an implied, subtle back story in The Invisible Boy, the robot is the same character as that in Forbidden Planet, which is set in the 23rd century; Robby is brought back to the film's mid-20th century era by time travel.
In 1957, ten-year-old Timmie Merrinoe (Richard Eyer) only wants a playmate. After a peculiar encounter with a supercomputer operated by his father's research lab, he is mysteriously invested with superior intelligence, and reassembles a robot that his father and other scientists had been ready to discard as irreparable junk. (It is explained that a vanished scientist claimed to have developed a time machine and retrieved the robot from the future -- a photograph on the wall depicts the return to Earth of the space cruiser from "Forbidden Planet," and the arrival of "Robby the Robot.") No one pays much attention to the robot after Timmie gets it operating again, until Timmie's mother becomes angry when her son is taken aloft by a huge powered kite that Robby has built at Timmie's urging (once Timmie, prompted by the supercomputer, has disabled Robby's programming to never endanger a human).
When Timmie expresses a wish to be able to play without being observed by his parents, Robby, with the aid of the supercomputer, makes him invisible. At first Timmie uses his invisibility to play simple pranks on his parents and others, but the mood soon changes, when it becomes clear that the supercomputer (which manipulated Timmie into altering Robby's programming, and its creators, over many years, into augmenting its intelligence) is independent, ingenious, and evil, and can control Robby electronically, later using hypnosis and electronic implants to control human beings, and intends to take over the world using a military weapons satellite. (It later declares its intent to destroy all life on Earth and then conquer the entire galaxy and exterminate any life that it contains, even bacteria.) The Supercomputer takes Timmie captive aboard the rocket, the army tries to stop Robby, but all of their artillery and weapons have no effect on him. Robby boards the ship, but frees Timmie rather than listening to the supercomputer, which had commanded him to kill Timmie by slow surgical torture to coerce his parents. Dr. Merrinoe tells Timmie and Robby to remain on board the ship as it has enough supplies for him to last a year, but instead goes to Earth.
Timmie and Dr. Merrinoe return to the lab to shut down the supercomputer, but it stops them. Robby then shows up, but turns against the supercomputer and destroys its power source. Everything is back to normal we find the Merrinoes having a peaceful evening, Dr. Merrinoe is about to spank Timmie as punishment for ignoring him. He is however stopped by Robby (whose protective programming has been restored), and the film ends with a shot of the Merrinoes and Robby all having a peaceful evening together.