It is helpful to start with the USGS definition of magnitude, which can be seen as:
based on measurement of the maximum motion recorded by a seismograph.
According to the Seismology Research Centre page Earthquake Size and the USGS FAQ page What was the duration of the earthquake? Why don't you report the duration of each earthquake? How does the duration affect the magnitude?, the duration and magnitude are generally related, specifically given that an earthquake is the movement (motion) of an area of a fault, rather than a single point -
So the larger the area of the fault that ruptures, the longer the duration of the earthquake. And larger magnitude earthquakes have larger fault areas.
In the case of the recent Nepalese earthquake, if the fault movement area was larger, then this potentially could have resulted in a larger magnitude, longer duration earthquake.
However, a major reason for the uncertainty (why the USGS page refers to the relationship as a 'general' relationship) is due to the geology of the affected area, from the USGS:
The duration of shaking at a point on the ground depends on how long the earthquake took to occur and how the waves move through the ground to that point. If there are a lot of reflections and resonances near the point (for instance in a sedimentary valley) the shaking will last longer. In an area without resonances (for instance on a hard block of rock) it will last a shorter time.