The song is the winner out of thousands of entries for the 2008 American Idol Songwriter's Competition, and was written by Regie Hamm. It was released as Cook's first single exclusively on iTunes on May 22, 2008. The next day, it was made available at all digital retailers. The song was sent to the radio stations following the end of the airing of American Idol finale in Hawaii.
In the U.S. the song debuted on the Billboard Hot 100 at number three with 236,000 copies sold in its first week of release. These figures give it the strongest first week sales of an Idol coronation single since season 2. The song debuted at number two on the Canadian Hot 100, blocked by Madonna's "4 Minutes". Due to low airplay in the U.S., the song was prevented from debuting at number one by Lil Wayne's "Lollipop" featuring Static Major and singer Leona Lewis's "Bleeding Love". In addition to its high opening week sales, "The Time of My Life" showed strong sales longevity, and has passed the million mark in digital sales. The song's sales and radio longevity allowed it to stay in the top 50 on the Hot 100 for nineteen weeks, before being removed from the chart after its twentieth week per Billboard's recurrent rules.
On June 1, 2008, the single entered the UK Singles Chart at number 61. It also debuted in New Zealand at number 29.
As of the week ending September 13, the single has reached number one on the Hot Adult Contemporary Tracks chart, number 28 and Top 40 Mainstream It is only the second coronation single of an American Idol winner to reach the top 40 on U.S. Mainstream radio, following Kelly Clarkson's "A Moment Like This." The song was particularly successful on U.S. Adult radio. The song reached number one on the Hot Adult Contemporary Tracks chart, breaking a 36 week streak of number one songs by female artists on the chart, and initially remained at the top spot for 11 weeks. During the Holiday 2008 season, Faith Hill's "A Baby Changes Everything" briefly overtook the number one spot on the chart, but "The Time of My Life" returned to the top in January 2009, where it has spent an additional three weeks so far. This brings its total to fourteen non-consecutive weeks at number one to date. Cook is also the second American Idol winner to top the chart, and the fourth contestant from the show to top it. The song has also enjoyed one of the longest runs at number one on the chart, placing in the top ten of longest running number one's by a male artist on the chart. It also reached the top ten on the Adult Top 40, peaking at number seven.
The RIAA certified "The Time of My Life" platinum on December 12, 2008 for selling over 1 million digital downloads, making it the second platinum-selling coronation song for an American Idol winner, after Kelly Clarkson's "A Moment Like This". It became the best selling coronation song by June 2009  As of June 2012, the single has sold 1.5 million units.
"The Time of My Life" took Song of the Year honors at the Nashville Music Awards October 7, 2009. Billboard has declared it "...one of the longest–running chart–toppers by a solo male artist in AC history." The hit single has joined the ranks of selected Nashville–penned songs that have achieved remarkable success at the number one spot, including Elvis' "Heartbreak Hotel" in 1956. The song hit the number one spot on the BillboardHot AC chart fifteen times, passing the fourteen week mark that Whitney Houston hit with Dolly Parton's "I Will Always Love You" in 1993.