How long can a leader rule a country?
In the us, for the president, its 4 years
He didn't rule it. In America, we do not have a king or a queen, so we do not say our President "rules" our country. Our leaders are "elected" by the voters. So, if you are asking when he was elected as the leader of our country, Barack Obama became president in 2008, and then was re-elected in 2012.
On October 25, 1917 (Russian calendar: March 7 elsewhere) Lenin became the de facto leader of the country because his Bolshevik Party had just ousted the existing government the Provisional Government. Since Lenin was the leader of the Bolshevik Party, and since the Bolshevik party was now in control of the government, Lenin was in position to rule the country.