I don't have advice specific to error correcting model (ECM) setting, but in undergraduate applied econometric class they gave us the generic advice to continue to extend lags in the model until the residuals of the fitted model were serially uncorrelated. For example, in the US life expectancy data, residuals of male life expectancy is serially uncorrelated in the AR(5) model but not the AR(4) model. You can see this for yourself with the following Stata code:
use http://www.stata-press.com/data/r8/uslifeexp.dta
tsset year, yearly
reg le_male L(1/4).le_male
estat durbinalt, small
reg le_male L(1/5).le_male
estat durbinalt, small
The Stata documentation for the vector error-correction models also seems to roughly follow this approach but it looks like it is automated under the varsoc function and additionally the AIC, HQIC, and SBIC are all generated programmatically.
To test for cointegration or fit cointegrating VECMs, we must specify
how many lags to include. Building on the work of Tsay (1984) and
Paulsen (1984), Nielsen (2001) has shown that the methods implemented
in varsoc can be used to determine the lag order for a VAR model with
I(1) variables. As can be seen from (9), the order of the
corresponding VECM is always one less than the VAR. vec makes this
adjustment automatically, so we will always refer to the order of the
underlying VAR. The output below uses varsoc to determine the lag
order of the VAR of the average housing prices in Dallas and
Houston....
We will use two lags for this bivariate model because the Hannan–Quinn
information criterion (HQIC) method, Schwarz Bayesian information
criterion (SBIC) method, and sequential likelihood-ratio (LR) test all
chose two lags, as indicated by the “*” in the output.
. clear all
. use http://www.stata-press.com/data/r13/txhprice
. varsoc dallas houston
Selection-order criteria
Sample: 1990m5 - 2003m12 Number of obs = 164
+---------------------------------------------------------------------------+
|lag | LL LR df p FPE AIC HQIC SBIC |
|----+----------------------------------------------------------------------|
| 0 | 299.525 .000091 -3.62835 -3.61301 -3.59055 |
| 1 | 577.483 555.92 4 0.000 3.2e-06 -6.9693 -6.92326 -6.85589 |
| 2 | 590.978 26.991* 4 0.000 2.9e-06* -7.0851* -7.00837* -6.89608* |
| 3 | 593.437 4.918 4 0.296 2.9e-06 -7.06631 -6.95888 -6.80168 |
| 4 | 596.364 5.8532 4 0.210 3.0e-06 -7.05322 -6.9151 -6.71299 |
+---------------------------------------------------------------------------+
Endogenous: dallas houston
Exogenous: _cons