With a hat-tip to DVK's answer from the script, we know from the film's Junior novelisation that the Falcon has been out of Han's possession for a considerable number of years.
Based on the fact that the narrator notes that the average person would have been expected to have forgotten the (relatively complex) startup sequence for the Falcon, that would seem to imply ten or more years:
“Gunner’s position is down below,” she [Rey] called to the young man [Finn]. “You ever fly this thing?” he shouted back. “Nobody’s flown this crate in years."
"But Han Solo was far from ready to give up his ghost anytime soon—especially when, after years of searching, he’d finally reunited with the only starship he had ever loved, the Millennium Falcon."
"Han left Chewie to bark out directions and hastened into the cockpit, where old habits took over. He sat in his well-worn seat and started flipping switches and turning dials to initiate the launch sequence. Though he hadn’t done it in years, never once did he hesitate; he knew the Falcon’s procedure by heart. Going through it in his head was how Han had coaxed himself to sleep on many a dark night."