You can limit the maximum duration of speech recognized in a GetInput XML execution through the executionTimeout parameter of the GetInput XML. Note that a maximum of 60 seconds of speech can be recognized in one execution of the GetInput XML.
To learn more about speech recognition-related timeouts, check out our reference guide here.