Muscat is pleasant from October through April. Daytime temperatures in that window run from around 25°C to low 30s, cool at night, and humidity is low — good weather for walking the souks and the corniche. December and January are the most comfortable and, unsurprisingly, the busiest.
Summer (May to September) is brutal. Daytime highs regularly exceed 40°C, humidity on the coast climbs above 80%, and the heat makes outdoor sightseeing genuinely unpleasant. Hotel prices drop, which is the only upside. Ramadan shifts each year by about eleven days; during Ramadan daytime eating and drinking in public is restricted and many cafés and restaurants stay closed until iftar, so plan accordingly.