Approximately 7 days.
From the moment that Bodhi defects to the end of the film (and the start of Star Wars: A New Hope) appears to be approximately 7 days. The times below are based on an assumption that there is a one day travel time between each of the planets seen in the film and borne out by Krennic's statement (at the end of the junior novelisation) that his week has been dreadful.
“An Imperial pilot—one of the cargo drivers — he defected yesterday,”
Tivik reported. “He’s telling people they’re making a weapon. The
kyber crystals? That’s what they’re for. He brought a message. He’s
got proof.”
Rogue One: A Star Wars Story – A Junior Novel
- Day 3 - Jyn rescued and taken to Yavin
Not even a day later, they delivered her to the headquarters of the
Rebel Alliance on a green moon orbiting a gas giant called Yavin.
There they hauled her in front of what she guessed must have been
their version of a court-martial.
Rogue One: A Star Wars Story – A Junior Novel
It was late into the night when the band left the desert for the rocky
slopes of a mountainside, then on from the mountain to the echoing
corridors of a stone shelter. Cassian recognized the heavier tread of
Chirrut’s partner at his side and risked a low murmur. “We’re half a
day out. A shrine?”
Rogue One: A Star Wars Story - Official novelisation
BODHI ROOK couldn’t remember a time he’d been so terrified, and the
past few days had been filled with all sorts of nerve-racking things.
He’d escaped from the Empire with a secret message from Galen Erso,
one of the top scientists in the galaxy. He’d delivered the message to
Saw Gerrera—and been tortured for it.
Rogue One: A Star Wars Story – A Junior Novel
and
Cassian thought back to the rumpled pile of a man he had found in the
catacombs, malnourished and battered and deranged with trauma. Less
than a day later, the man leading him through the canyons of Eadu was
transparently terrified and far too eager to chat; but he was also
doing his damnedest to feign normalcy on what looked likely to be a
suicide mission. He was even doing a decent job of it.
Rogue One: A Star Wars Story - Official novelisation
KRENNIC HAD THOUGHT he’d already had the worst week of his life. Worse
even than the one during which Galen Erso had abandoned their work on
the Death Star and gone into hiding, leaving Krennic alone to head up
the project.
He’d already lost control of the Death Star to Grand Moff Tarkin. He’d
been threatened by Darth Vader. And he suspected if he failed at his
current task, he would probably be executed, perhaps by the Emperor’s
own hand. But this week kept finding ways to become even worse.
Rogue One: A Star Wars Story – A Junior Novel