"Spaceman" is a more colloquial term that can refer to astronauts or to anyone who travels in space, including cosmonauts (from Russia) and taikonauts (from China). In general, "astronaut" is the more formal and widely recognized term, while "spaceman" is more informal and can be used in a broader sense.
an astronaut (= person who travels into space)