When do my soldiers gain ranks?

Solution 1:

As this wiki page suggests (game mechanism tuning, did not tested myself), there is a XP chart for your soldiers:

Soldier XP Levels (Rookie, Squaddie, Corporal, Sergeant, Lieutenant, Captain, Major, Colonel)  
  - m_iSoldierXPLevels=0  
  - m_iSoldierXPLevels=90 
  - m_iSoldierXPLevels=300  
  - m_iSoldierXPLevels=510  
  - m_iSoldierXPLevels=745
  - m_iSoldierXPLevels=1100  
  - m_iSoldierXPLevels=1560 
  - m_iSoldierXPLevels=2150

Though kills does not make all. It does bring experience, as stated in Does the type of kill matter for promotion?, but all your promoted soldiers did not necessarily killed a target. It can be assumed that participating to a kill also grants some experience.

Furthermore, I think there is a mission bonus awarded to each surviving soldier.

There are also bonus that can be bought through the soldier academy: wet work that increase the amount of experience gained and the new soldier auto-squaddie promotion come to my mind.

Solution 2:

The XP chart for promotions is correct. However - you don't have to kill to earn points. For example: A Sectoid kill gives you 30pts. A successful abduction mission gives you 80pts.

Make 1 Kill, survive, accomplish mission = 110pts aka Squadie promotion. Don't make a kill, survive 2 accomplished missions = 160pts