There are various conflicting stories regarding the origin of the phrase. One of the origin stories is linked to the ten steps to enlightenment in the Buddhist faith. However, there is little evidence to support the claim. In the 1896 edition of the "International Cloud Atlas", cloud was assigned the number 9. It is the highest reaching cloud and rises up to 10 km (6.214 mi) into the sky. Thus, being on top of it would mean that you are in a sense "on top of the world". The phrase origin might not be known but has been used since the 1950s as a state of perfect or extreme happiness. If you say that someone is on cloud nine, you are emphasizing that he is very happy.

One of the good example that can be found is from "The Denton Record Chronicle", May 1949, when Betty Hutton - a woman who was happy to have been selected for a film role. "Let's look in on Betty Hutton, who says she is hovering 'on cloud No Nine', these days." It seems as if the phrase gained popularity during this time. There was even a yacht called 9 that took part in a race around Catalina Island in June 1947.

More Info: knowyourphrase.com