A few hints at the concept, but no evidence that it’s actualy been done.
There’s enough evidence to suggest that magical society has discussed the possibility of leaving Earth, but nothing to suggest that they actually have.
According to the HP Wiki, then there was a portrait of a witch flying to the Moon in the film adaptation (I haven’t verified this). Here’s the picture they provide:
Without tracking down the individual clip, I can’t be sure whether she actually flies to the Moon in the portrait, or just sits there. But hey, it’s something.
When Harry first picks up a copy of The Quibbler, there’s an individual who claims they flew to the Moon on a broomstick:
He flicked through the rest of the magazine. Pausing every few pages he read […] an interview with a wizard who claimed to have flown to the moon on a Cleansweep Six and brought back a bag of Moon Frogs to prove it.
— Order of the Phoenix, chapter 10 (Luna Lovegood)
However, Moon Frogs are never mentioned again, nor is this person, and it was published in the Quibbler, so it’s of dubious quality.
(Now, perhaps he hoped to be able to compare his captured Moon Frogs to existing specimens, which means that somebody else would have to have already been to the Moon. But that logic seems a bit advanced for somebody who publishes this tale in The Quibbler.)
When Ron is trying to flirt with some Veela in the Quidditch World Cup, he makes bold claims about an impressive space-related invention:
He turned to tell Ron this, but Ron’s face had gone oddly slack, and next second Ron was yelling, “Did I tell you I’ve invented a broomstick that’ll reach Jupiter?”
— Goblet of Fire, chapter 9 (The Dark Mark)
I’ve gone over all the Famous Wizard Cards I know about and found no reference to space exploration. I also looked through Quidditch through the Ages, and the best I could find is a broom called a “Moontrimmer”, but this is almost certainly a marketing term rather than a statement of actual ability. I’ve also not seen anything in Pottermore about this.
Perhaps wizards have their own version of science fiction, where they talk about travelling to the Moon and similar faraway places, like Muggles did. But what would they call it? Unscience fiction?
It’s not explicitly stated, but I suspect space exploration would be impossible with current magical technology.
Our nearest celestial body, the Moon, seems out-of-reach for the two most common forms of magical transport: brooms or apparition.
Brooms fail on both range and speed. I see them more as analogous to small aircraft. We learn that crossing the Atlantic on a broomstick was quite a momentous achievement (cf. Amelia Earhart):
Jocunda Sykes (b. 1915)
Famously became the first witch or wizard to fly across the Atlantic Ocean on a broomstick, in 1935. She rode an Oakshaft 79.
— Wizard of the Month, JKRowling.com (January 2006)
The Moon is an order of magnitude further than the Atlantic.
Then there’s speed. When Harry first sees the Firebolt in the window of Quality Quidditch Supplies, he learns its acceleration:
The Firebolt has an acceleration of 150 miles an hour in ten seconds and incorporates an unbreakable braking charm.
— Prisoner of Azkaban, chapter 4 (The Leaky Cauldron)
Travelling to the Moon at 150 mph would take about 65 days, which probably puts it out of the question. For contrast, the Apollo 11 rockets travelled at about 25,000 mph.
(As @user20310 points out in the comments, acceleration =/= maximum speed, but we have no evidence that a Firebolt can travel within an order of magnitude of the speed necessary. I’m guessing that it can’t.)
The broomstick simply can’t travel far or fast enough to reach celestial bodies, and if it could, it offers absolutely no protection to the occupants. Anybody who tried would be dead long before they got anywhere.
Although they’re discussed much because they’re banned in the UK, flying carpets are mentioned in the series. I think we can discount them for similar reasons.
We’ve discussed the physical limits of apparition before, and it does have an implied distance limit. It also seems that you need to focus on your destination in some detail for apparition, and so apparition is probably out for the first trip to the Moon.
Unless the Ministry have an enormous sleeve and something equally enormous tucked up inside it that is capable of fast, long-distance, safe flight into space, I would guess that the magical community have never gone into space. Sadface. :(