To quote Pirates of the Caribbean, sentencing guild-lines are "More like guide lines than actual rules" (well duh, it's in the name) and as such, other than the statutory minimum (if it exists, if not, a felony is any crime that carries a possible jail sentence of a year or more) and the statutory maximum (always exists) the range and severity can vary based on aggravating factors (stuff specific to the case that makes the defendant's criminal actions look worse than a typical offender) and mitigating factors (case specific that make the defendant look less worse than a typical offender) as well as criminal history (is this your first crime? You probably won't get a sentence as rough as someone who has been before a judge more than a few times.). Additionally a Judge can make the sentence for each charge concurrent or consecutively served (concurrent sentences mean that jail time counts for each charge that is concurrent, so if you have 5 counts with a 5 year sentence, in 5 years time in jail, you've payed your debt to society. If they were consecutive, then for each five year period, you've paid your debt to society for on charge and will be in jail for 25 years for all five charges. Assuming no parole is issued in either case.)
While typically the judge will follow guidelines of the prosecution, they need not and the judge may be inclined to grant a tougher or softer sentence and ultimately they are the the only person to issue a sentence. The check on the judge is the appellant process (only the defense can initiate appeals. Double Jeopardy blocks prosecutors from starting the process, but once started, they can appeal appellant decisions) and sentences are Questions of Law, not Fact (nobody can start an appeal on evidence used in trial, or "Facts" of the trial... only matters of the Laws cited at trial.). A defendant who was given a harsher sentence than what even the prosecutors wanted will have a good chance of getting his appeal before a judge, while the prosecutors cannot appeal a lighter sentence than the judge gave because again, they can't start appeal processes). Because of this, it's very rare for a U.S. Judge to actually come down harder than what the prosecutors want.
Given that the initial recomendation in this case was 7-9 years (I believe the max) and Barr revised to 4 years and the judge giving 3 years, it's likely that the judge in question may have independently concluded that the 7-9 years was over the top, given all things considered but was mad that Trump and Barr had dragged a strictly legal matter into the realm of partisan politics (Judges are not supposed to be political on the bench and many go through great pains to try and eliminate the appearance of political hostility to a party in a case before them, even if they politically disagree with one of the parties.) which would explain the dressing down of Stone, Barr, and Trump, but the very generous ruling (a year less than what Barr wanted and only after conducting a review of possible jury bias for a second time is very favorable to Stone, given the circumstances). Please keep in mind that this is my own personal read of the situation and in no way is meant to ascribe true motives to the Judge's decisions (I have not had the opportunity to read her full decision and what she considered and accepted or rejected.). I am merely pointing out that the judge thought that even Barr was a bit too harsh in his revised recommendation.
In conclusion, the Judge can issue any sentence that is equal or greater than the statutory minimum but less than or equal to the maximum sentance. The prosecution's requested time will often be the judges' base starting point, but he or she is within their right to accept it fully, or toss it in the trash. They rarely issue harsher than recommended sentances, but it's not uncommon nor without exception (remember that Califorina judge who got recalled because of the very light sentancing for a rapist? His sentence was following the exact guidelines of the prosecution and were minimum under Cali Law... had he balked that such a low sentence for the crime was possible, he probably would still have his jobs as even appeals courts don't kick out judges for bad calls. Remember, that what is "legal" and what is "Moral" are not the same thing. The judge in question was making a legal decision, not a moral one. For the sake of the brevity, I will not be discussing the merits of judges being moral vs. legal in my answer.).