The program you're talking about is a short-lived sitcom from Fox called "Second Chance" that aired in 1987. Matthew Perry (later to be famous on "Friends") played the teenage Chazz Russell, and Kiel Martin (previously on "Hill Street Blues") played Charles Russell - who is actually Chazz's future self from 2011.
In the pilot, Charles Russell dies in 2011 in a hovercraft accident and goes to St. Peter's office. St. Peter tells him that he's neither bad enough for Hell nor good enough for Heaven, so he's given the chance to go back and guide his past self onto a better path.
Back in 1987, Charles poses as "Charles Time" and tries to avert his teen self Chazz's most major mistake: trying to solve his family's pressing money woes by robbing a mini-mart of the cash it's collected from lottery tickets just before the drawing.
Charles is there at the mini-mart as the clerk and discourages the robbery; he also changes the numbers on the ticket Chazz buys, so that four of the six match and the ticket is worth a few thousand dollars (Charles was trying for a larger win, but he couldn't remember the last two numbers.)
He thinks he should go to Heaven now, but St. Peter explains that he only changed the circumstances; he's going to have to stay on Earth until he and Chazz both learn the difference between right and wrong ("That long?!", Charles exclaims.) Since he'll be staying longer than expected, Charles rents a room in Chazz's house to be on-site as a mentor.
The show only lasted nine episodes in this format; it was put on hiatus, and came back in a format that dropped the supernatural elements (and thus the characters of Charles Time and St. Peter) called "Boys Will Be Boys". The revamped show only lasted twelve episodes.
The pilot episode is on YouTube in three parts; you can see in the final segment most of the elements of your description.