It's not going to happen in our solar system at this point in time. Way back in the first few hundred million years before the solar system settled down, then there were impacts like this. One of them formed the Moon.
There is a remote chance also of this happening in the far future, when Jupiter might push Mercury out of its orbit - that's because Mercury is so light, and because of a coincidence that the rate of precession of the perihelion of Mercury is almost identical to the rate of precession for Jupiter. The chance of Mercury either hitting the sun or escaping the solar system or hitting Earth or Venus is 1-2%, chance of hitting Earth is lower, and all that is for several hundred million years into the future.
There are large comets out in the large distant spherical Oort cloud, and the inner disk of the Kuiper belt, and many are as large as this or larger - but even if they do come into the inner solar system, they will most likely hit Jupiter, or else turn into sun grazers and eventually be evaporated by the sun. We can tell that because there are no huge recent impact craters - as big as the ones that formed the Mares on the Moon say - on any of the planets in the inner solar system or our Moon. Plenty of 100s of kilometer or so diameter recent craters, but the bigger ones are all ancient. So impacts like this just haven't happened for billions of years.
So, other than that it would need to be result of technology, maybe a result of warfare between Earth and space colonies - but it would be an awesome level of technology if humans were able to divert, say a moon of Jupiter or Saturn to impact the Earth.
An impact like the one you've illustrated here would form a second Moon, most likely, which would orbit closer to the Earth to start with. To start with there would be a debris ring so you'd get a ring system rather like Saturn's rings but smaller, form around Earth. And then those rings would begin to condense into moons, or a single big moon close to Earth and eventually you end up with a two moon planet.
As for our astronaut on the Moon, well it all depends, if he or she has a base.
With an object this large you'd see it in telescopes easily right across the solar system - it is bigger than Mars's moons. It looks like it is probably as big as the moons of Jupiter. So our astronaut has probably known about it for thousands of years in advance :).
So surely our astronaut has a base on the Moon and surely humans have evacuated the planet long before. And probably somewhere out of the picture, there's a Stanford torus or some such.
With an impact this big, then the Moon would not be a safe place to stay for long, you might survive but you might on the other hand be the target zone of a big meteorite that hits the Moon. Even in a deep underground base. Even many kilometers below the surface I think there'd be major risk of damage from impact Moon quakes etc.
So I think this astronaut surely has a base to retreat too, maybe in a luanr cave - and also a spaceship out of sight in the picture which he or she can use to escape to a Stanford torus well away from the Earth. So I wouldn't worry about it too much :).
And as for ourselves, well there is nothing we know of likely to create a scenario like this.
So - this is for an "alternative Earth".
Or else, for a time some far distant future probably hundreds of millions of years away, and low probability even then.
In that case the impactor is probably Mercury, is my best guess. And if we still have space flight capability - well there are ways of moving even planets in their orbits. You can use a "tractor asteroid" that does repeated flybys of Jupiter and of your planet, and each time it adjusts the planet's orbit just a bit. And needs hardly any delta v, by using "keyhole" type trajectories where it aims at points where a slight deflection causes big changes in its later trajectory.
Short term, that doesn't have much effect. With just a few years notice you couldn't do much in that way. But if you had hundreds of thousands or millions of years you can even move Mercury that way (use our gravity tractor to counteract Jupiter's nudging influence to keep it in its orbit), or Earth or Mars. We probably don't need to start on such a project right now, but we can think about ideas for the future.
We might want to move the Earth anyway, in order to keep it in the habitable zone when the sun goes red giant in the future.
To do that, you can use a 100 km diameter asteroid as a gravity tug that does repeated flybys of Jupiter and Earth. That's not that huge an asteroid - it is a size you could imagine with future mega technology we might be able to divert quite easily, and are loads of asteroids that big in the asteroid belt, or the Jupiter trojans or whatever.
It only needs to do a flyby of Earth every 6,000 years to do the trick. So - every few thousand years as it approaches Earth or Jupiter you have to do some careful fine tweaking of its trajectory. But most of the time you can just forget it. So we would move it out of the way of potential impactors like this at the same time, or else, use other gravity tractors to move these objects out of a collision course with the Earth.
For some fun other ideas for ways to move the Earth, see David Brin's Let's Lift The Earth!
But - our priority at present is to deal with the smaller impactors. Up to a few kilometers, but most likely to be of the order of a few hundred meters at most, the larger ones are so rare there is almost no chance of one of those before, say, 2100.
And those are small enough so that given say a few years warning, we have a chance of doing something about them by much simpler measures, e.g. gravity tug by a small spacecraft and ion thruster would deflect even quite a large asteroid enough if applied continually for a few orbits.
And - there's an asteroid mapping program underway which has already plotted many of the potential threats and will probably succeed in plotting nearly all the near earth asteroids up to 300 meters diameter or larger by the mid 2020s. So far no threats have been found. There have been a few that were on the table for a while until the orbits were refined and they were found to miss the Earth. And lots that do near misses, but nothing headed our way in the next few centuries.
Though smaller ones, of the order of meters to tens of meters - they hit the Earth regularly. Causing spectacular fireballs and sometimes small craters. And occasionally may fall close to an inhabited area. And can cause damage as the Russian meteorite example showed. They are more of a challenge, not expected to map them all by teh 2020s though sometimes we spot them on their way to Earth up to a day or so in advance, if so that might be enough time for a useful warning if they were headed towards somewhere populated - like the Russian meteorite, but at present we don't have that capability. They are just an unavoidable low probability risk we face, like earthquakes, and volcano eruptions.