The Blades are bottom of the Premier League, 18 points from safety, with seven games left.
Sharp, who has scored three goals in 14 top-flight outings this season, picked up the injury during training.
"Always gutting to miss games so to be ruled out for the remainder of the season hurts," said the 35-year-old on social media.
"Sadly the injury was worse than I'd hoped but operation went well and will be back stronger next season to get my 250th goal in front of a packed Bramall Lane."
Sharp scored the 249th goal of his professional career in a 1-0 FA Cup win over Bristol City in February.