The weather in Malaysia is characterised by two monsoon seasons; namely the Southwest Monsoon from late May to September, and the Northeast Monsoon from November to March. The Northeast Monsoon brings heavy rainfall, particularly to the east coast states of Peninsular Malaysia and western Sarawak, whereas the Southwest Monsoon normally signifies relatively drier weather. Hence, a "monsoon" does not necessarily mean rain, it is just the name of the prevailing winds blowing at a certain time.
What is called "heavy rain" in Malaysia, more often than not qualifies as a storm in other parts of the world. But because the rains come almost daily, Malaysians handle the rain with nonchalance. During rainfall, locals would just go indoors or hit the shopping malls. Avoiding driving during heavy rains is another ritual, to avoid the massive traffic jams that can occur.
The temperature is pretty stable all year round and mostly between 25 to 32 degrees Celsius during daylight hours in the lowlands. You have basically come to the right place if you are looking for warmth. Apply water-resistant sunblock if you plan on going outdoors and sunglasses/hats are recommended at the beach. Though it may be cloudy, UV rays can penetrate through the clouds to burn the skin. Malaysia is also very humid, almost 90% and you will be sweating even if you stand still!
When to visit Malaysia is a matter of preference. Different states are affected differently by the different monsoon seasons.
For example, Kelantan and Terengganu are flooded annually by the Northeast Monsoon from November to March; and the small islands on the east coast such as Perhentian, Redang and Tioman essentially shut down for the season. Conversely, the Northeast Monsoon is the best time to visit the north western part of the Peninsula, as the monsoon does not affect the states of Penang, Kedah or Perlis as much from December to March.
During July to October, Indonesia practices large scale clearing of land by the burning of forests or plantation land on an industrial scale. As a result, smoke is blown by the South West monsoon winds throughout the south-east asian region. The South West monsoon is generally dry, hence there is very little rain to kill the fires, so an unpleasant level of pollution can appear at some point between July and October. This pollution can last between 2 weeks to 2 months (the record-length was in 2015). At the best it is not noticeable, at worse it gives a heavy dense haze with little visibility which can be dangerous to heath. The impact will solely depend on the areas being burnt and the direction of the prevailing winds.
Otherwise, the best way to decide when to come to Malaysia is to consider the timing of various events to be held. Look for an annual event calendar from the Tourist Board, or other sources, and research the various festivals or events held in that year. August, the month of Malaysia's Independence Day provides great sales for shopaholics and cool parties and concerts for club-hoppers and party-goers.
In the end, no matter when you come to Malaysia, it will be hot and humid; you may see some rain, but the sun will shine. You can be assured of delicious food being always widely available and something to do no matter the weather or the time of year.