In "The Adventure of the Final Problem", Holmes fakes his death to escape the clutches of Professor Moriarty. He goes into hiding for a few years, allowing Watson to believe he's truly gone.
When Holmes returns, he picks up his life where he left off. He and Watson continue their partnership, solving mysteries and enjoying their shared friendship.
They never explicitly end their partnership or have a "final" story. While there's no final chapter in their relationship, Doyle himself ended his involvement with Holmes in 1927 with "The Adventure of the Shoscombe Old Place". He wrote several other stories featuring other characters, but never revisited Holmes after that.
Therefore, the last story by Doyle featuring Holmes and Watson is "The Adventure of the Shoscombe Old Place", where they continue their partnership with no indication of a final farewell.