How to check for the distribution stability? I need for verifying that the training set I'm using to build a model is equally distributed to the test set. 
The model is for prediction purposes and I think it is necessary the 2 samples are equally distributed; in such sense, it is needed to test that the sample on which you build your model (training set) is distributed as the sample on which you backtest the model (test set). 
Usually, in credit scoring/rating model the population stability index is used for this purpose, but it does not seem to be a robust statistical measure.
In your opinion, could I use the K-S two-sample test?
Alternatively, can you suggest some other statistical measure or test better than that one to check for the  distribution stability?    
 A: In the limit as the quality of your random sampling method approaches perfect randomness, and in the limit as number of samples approach infinity, then the distributions of the training and testing samples will become identical.
But after considering your comment to dsaxton, it appears that you are in a special case where you are dealing with time series problems.
Usually with common learning tasks when the time of the sample arrival is ignored, it is implied that all samples occur at the same time. Therefore, the PDFs of the training samples are assumed to be the closest estimation to the PDF of the testing set (since they all occur at the same time). In this case, random sampling is your friend.
But, since you are not assuming the simplistic assumption above, instead you are acknowledging the fact that testing instances are necessarily those that appear after the training samples (which is a more realistic assumption), then it is part of your time series problem that your model must deal with the fact that the PDF of the arriving samples changes as a function of the time.
Therefore, when dealing with time series problems, you must not eliminate the shift/change in PDF as time passes across the training and testing sample sets. Instead, take it as a challenge to identify how well your model is adopting to the fact that the PDF is shifting/changing over time.
If you eliminate such challenge from the evaluation by constructing training and testing set that maintain the same PDF (despite the time shift), then you are essentially performing an evaluation that does not show how useful your prediction model is in time series problems.
Alternatively, you can consider that time series problems are a special case of domain adaptation problems, where the domain variation is caused by variations in the time.
So in summary the answer is: you must not ensure identical/similar PDFs between training and testing samples, because it is a primary objective of your model to adapt to the fact that the PDF is shifting by time.
Q: In your opinion, could I use the K-S two-sample test?A: No.
Q: Alternatively, can you suggest some other statistical measure or test better than that one to check for the distribution stability?A: Yes. Do nothing about it. If you wish more samples to better identify the PDF shift as a function time, then this is another problem (where you can find out amount of training samples that you model needs less/more samples compared to other models).
A: First, about measuring the fit.
The Kolmogorov–Smirnov test is for a one-dimensional distribution. Though it was extended to multivariate data, it wasn't designed for time series.
I'm not sure how do you use your time series data.
If you are interested in just the probability of an event to happen, you can use the test.
However, note that you will lose all information like "Event B always comes after event A" and that might be where the gold is.
Going a step backwards, you said that you used your old data as the train and the new data as your test. You can split your data in different ways and avoid the problem in the first place.
In case that you are interested in predicting future behavior, you can split each time series into past (train) and test (future). Note that you can choose a different point for any series. This way you can train on that that now is considered to be your future and still get a valid estimation.
Sometimes it is required that all the series will be split in the same point in time.
In this case, you might consider creating a few data sets (e.g., one ending in January, one ending in February, etc).
The advantage here is that you will be able to estimate how good your model is as time changes. Note that while it is likely that the underlying distribution will change, your model is probably looking for a narrower aspect and might be more robust.
You might be coping with a problem of concept drift (or time-related domain adaptation). Reading some surveys on these topics might give you some useful ideas.
A: If you selected training and test sets randomly from your data, you shouldn't have to worry about equal distributions.
More importantly, you test your model, which you generated from the training set, on the test set and by doing this you verify that you can use your model to predict other values than the ones from the training set. If this works, you won't have to worry about the sets being equally distributed.
A: It looks like you're generally looking at the question of whether your time series is stationarity. The other answers discuss great ways to handle time series while doing machine learning.
Separately from the ML lens, if you just want to understand the stationarity of your data, you can use the Augmented Dickey-Fuller (ADF) test or the Kwiatkowski-Phillips-Schmidt-Shin (KPSS) test. Both of these tests are implemented in the python statsmodels package, though it should be noted that these tests shouldn't be directly interchanged as they test for opposite hypotheses.
This blog post gives a great explanation
