I have been working on EMG signal analysis for control applications. The processing includes the detection of onset and offset time and other signal parameters.
I think this parameter must be set empirically. I have seen (by experiments) that a sliding window of 5 seconds works fine, however, according to the sampling rate used different sliding window sizes can perform better.
The choice of sliding window depends on your sampling frequency. Please read following papers, they explain effect and choice of window length in EMG based hand gesture classification.
Article A Robust, Real-Time Control Scheme for Multifunction Myoelec...