The British world number two trailed two sets to one when play was suspended on Monday because of bad light.
Murray, 29, won the fourth set but was pushed hard by his Czech opponent before winning the deciding set to clinch a 3-6 3-6 6-0 6-2 7-5 victory.
The last time Murray lost in the first round of a Grand Slam was in 2008.
A three-time French Open semi-finalist, he has now come f-rom two sets down to win nine times in Grand Slam matches.
Murray joins compatriots Aljaz Bedene, Kyle Edmund and Heather Watson in the second round, while Johanna Konta and Laura Robson play their first-round matches later.
Murray will next face French wildcard Mathias Bourgue, who is ranked 164 in the world.
- Round-up: Nadal thrashes Groth but Kerber goes out
- Scores and results: Today's matches
When play began on Tuesday, Murray survived two break points in his opening service game before levelling the match by breaking.
But Stepanek, the oldest man in the draw, continued to frustrate the Briton with some inspired shot-making in a nervy fifth set.
Murray was two points f-rom defeat when serving at 4-5 but held on and broke in the next game.
He double-faulted on his first match point but sealed victory after three hours and 41 minutes when Stepanek netted an attempted d-rop-volley two points later.
Murray, who sportingly applauded Stepanek off the court, said: "He had an extremely bad injury last year and still at 37 coming out and fighting like that, playing that way, it's unbelievable.
"I don't expect to be doing that myself at that age. I'm just glad I managed to get through.
"He's always been extremely difficult to play. I wasn't able to dictate many of the points, I wasn't in a great rhythm, and that's credit to him and the way that he played. I fought extremely hard today and I'll get a chance to play again tomorrow."
Analysis
BBC tennis correspondent Russell Fuller
"Stepanek played a magnificent final set: serving and volleying himself out of trouble when the occasional break point down and engaging theatrically with the crowd, which warmed to a 37-year-old who is a real craftsman of his trade.
"Murray was two points f-rom defeat at 4-5 deuce in that deciding set, but it is notable that with his French Open on the line he did not face a single break point in the final set.
"Stepanek's poor final service game cost him dear, and despite serving a double fault on his first match point, Murray did not let him off the hook. The reserves of nervous energy have been depleted, but rather that than an early start to the grass-court season."
British players at the French Open | ||
---|---|---|
Draw | In | Out |
Women: | Heather Watson, Johanna Konta, Laura Robson | Naomi Broady (first round) |
Men: | Kyle Edmund, Aljaz Bedene, Andy Murray | None |
Bedene recovers f-rom poor start
The British number two began his match against Austrian qualifier Gerald Melzer with two double faults and lost the first eight points.
But he was the better player after that and came through 4-6 6-3 6-4 6-4 to reach the second round for the first time.
Bedene, who is being coached on a temporary basis by GB Davis Cup captain Leon Smith, will play either 31st seed Federico Delbonis or Spain's Pablo Carreno Busta in the second round.
Edmund to face big-serving Isner
Edmund will take on 15th seed John Isner in the second round after the American fired down 40 aces to overcame John Millman of Australia.
Isner won 6-7 (4-7) 7-6 (12-10) 7-6 (9-7) 7-5 in another match played over two days.
Edmund beat Georgian qualifier Nikoloz Basilashvili on Monday.
Subscribe to the BBC Sport newsletter to get our pick of news, features and video sent to your inbox.