I get it barely done, technically fulfilling the requirements. How much more I clean up depends how much more time my PM has left me in the sprint. Since I'm constantly bombarded by questions, appeals for help, requests to approve pull requests, last minute changes, various meetings etc., that usually is not much, if any, time.
Of course, you need to pick the right battles. Sometimes that hack to fix a production issue will stay like that for ages, and the proper fix will never be done, and that's the way it is.