Vietnam has tropical weather marked by a monsoon season. It is typically humid and warm, although the weather can vary significantly from one area to another due to the long length of the country which covers several weather zones and the variance in altitudes (in recently there has been aften snow in Sapa and Lang Son while it was quite hot in Saigon).
Flooding is also common in the central coast region around Hue and Hoi An. Since flooding is common, most important for traveling in is avoiding the monsoon season.
Temperature remains almost constant in Saigon while in Hanoi there is a marked cooler, although pleasant season from November through March and warmer period during the summer ("cooler" is relative, you will not likely need a jacket). See our charts below, showing the levels of rain and temperature for north, south, and central by month of the year.
During December, the weather north of Danang (and the Hai Van Pass) can be cool and rainy. January is an optimal month to travel the length of the country (combined with humidity, it is not as cool as the chart below reflects). However, Sapa does not thaw until around the first week of March.
Specifically for Sapa, September through November and March through May are the best times for trekking and cycling in Sapa. Daytime temperatures range from 15-28 C, and night-time temperatures from 18 down to 10 Celsius. Trekking and cycling are possible at other times too, but the wintertime can be rather chilly, and the summer rather wet.