The model I am working on has 4 time series (X, X1, X2, X3). Lag lengths are 5, 1, 4 and 6, respectively. X1, X2 and X3 are stationary at level and X is stationary at second difference. I am applying VAR at level data to find the relationship between them. I have to choose appropriate lag length and I don't know what the lag length should be. Should it be the maximum of the four time series' lags? Or is there any other method?
In general lag length in VAR models is selected using statistical information criteria. This means that VAR models are fitted for various lengths an certain statistic is calculated. The lag length is taken to be of model with the smallest statistic. Naturally you should think whether lag length from such procedure conforms to your model. Large discrepancies (very large lag length, when it is clear that the impact from the variables at large lags cannot be relevant) usually indicate that something is wrong with model specification.
Although lag length selection is important procedure it is only but a small part of VAR modeling. This is why it is usually mentioned briefly, or omitted entirely. For more examples you can read R package vars vignette. Lag length selection is mentioned in section about cornerstone package functions and in the examples section.