With current technology? Not much further than our solar system.
We rarely take direct images of exoplanets. The majority of exoplanet detection methods involve observing the star it orbits, then looking for anomalies its gravity or luminosity that could only be explained by the existence of a planet of a certain mass or size. Gravitational methods will not reveal anything about the shape of the planet. Luminosity methods might - see the edits below.
Direct imaging won’t be of much help. To date, the smallest exoplanet ever directly imaged is Candidate 1 in the Alpha Centauri system. It is approximately half the radius of Jupiter and just over 4 light years away. Here’s the image (the planet is labelled C1)
Image from Wikipedia. If this planet was a Cube, it would still be difficult to tell from this image alone. And this planet is several times larger than your Cube Earth. The Cubic nature of your planet cannot be confirmed until significantly better telescope technology is invented.
Edit: In light of other responses, I must admit that it’s not entirely impossible to detect a cube world with current technology. But as others have mentioned this will depend on a number of factors. It’s nevertheless an unlikely conclusion that would be very difficult to confirm with certainty, but not impossible.
Edit 2: So I decided to do a little more research. This post found that the projected surface area of a rotated cube can increase by up to a factor of √3 times the area of a single face. This means the apparent size of the Cube world can fluctuate by up to 73% in the best case, though this would require the cube to be tumbling in an unnatural way. This could certainly be noticed as unusual considering that the apparent size of a spherical planet doesn’t change significantly as it rotates. But you still run into issues with size - terrestrial planets are much harder to detect than gas giants. A luminosity based detection method like transit photometry works by measuring the star’s change in apparent brightness caused by an orbiting planet passing between the star and the Earth, obscuring some of its light. For an Earth sized planet in an Earthlike orbit around a Sun sized star, you’re usually looking at a change in apparent brightness of ~0.008%. Because the Cube world’s shadow will change in size as it rotates, the change in apparent brightness could fluctuate by as much as 0.008% to 0.013% on a period equal to the Cube world’s rotational period. Assuming that’s 24 hours, our current telescopes are definitely sensitive enough to notice something strange. Since your Cube Earth also has a Cube Moon they’d notice some anomalies from that as well. Still, a cube shape is not a likely conclusion to draw from these observations. There are other configurations of planets and moons in odd orbits that could produce a similar effect which would be deemed more likely than an artificial Cube world. Because of the planet’s relatively small size it would be impossible for our telescopes to truly confirm one way or the other. But the Cube world would be a valid theory that matches the data.
In summary: Your best case would be to have the Cube rotating on a short period like 24 hours, and to be in an orbit around a relatively small star which happens to transit between that star and the Earth. Ideally its axis of rotation should be perpendicular to our viewing angle to maximize the fluctuations in its apparent size. In this case the Cubic nature of the planet could theoretically be detected from several hundred light years away. In worse cases, like the planet not being in a transiting orbit, it might be impossible for current telescopes to notice anything strange at any distance. I maintain that the range at which we could confirm without a doubt that this planet is a Cube is not much further than the confines of our solar system.