As and said, the astronauts on the ISS do have access to the internet. But the question asked if the astronauts had internet access in outer space. Since the only astronauts in space right now are on the ISS, and there is nothing else that will be happening any time soon to take astronauts anywhere else, the answer is still sufficient. But what *IF* we did have astronauts heading to Mars or the Moon? Would they have internet access? My guess: Mission to the moon? perhaps. Mission to Mars, no.
To have internet access on a trip to Mars, you need a network. The only network in place right now is called the Deep Space Network.
It is what the Mars Reconnaissance Orbiter, Mars Science Laboratory Curiosity and Cassini use to communicate with Earth and send us all of those pretty pictures. Air time on the DSN is very limited. Scientists will not be happy if they can't communicate with those probes because an astronaut flying to Mars wants to watch Gangnam Style on youtube.
Now, there are some new ways for communications that are being developed. My favorite is the laser communications project that is still very much in development. We have sent images to the Lunar Reconnaissance Orbiter using lasers, and have received data from Lunar Atmosphere and Dust Environment Explorer (LADDEE) over lasers as well.
So, about that trip to Mars. Assuming we get the laser comms working, they still would not have internet access, at least not the way you are thinking. The reason for this will be the time it takes for the data to travel at the speed of light to and from Mars. If Mars is on the other side of the sun, it take about 15 minutes for signals to travel between the earth and Mars. So once you click on the video, it will take 15 minutes for that signal to make it to earth, and then another 15 minutes to send the video from earth to Mars. So no web browsing. Email, on the other hand, sure. Including attachments. That will be fine.
Astronauts on trips to the moon very well may have internet access, although, again, it probably won't be like web browsing and streaming Netflix. It only takes 1/2 second for data to travel between the earth and the moon, so the latency won't be an issue. The bandwidth is the issue which would be solved with the laser comms.