To be eligible for citizenship, an applicant must have continuously lived in the United States as a green card holder for at least five years (or at least three years if they’re married to a U.S. citizen).
“Continuously” means they did not take any trips outside of the United States that each lasted six months or longer during the 3–5 years they were required to have a green card (plus the extra period while USCIS processes their U.S. citizenship application).
In other words, an applicant is allowed to leave the United States — they just have to make sure to return within six months every time.
You can read more about continuous physical presence requirements here.