Depends on whether you're redoing the jambs and trim. Many insta-window replacement companies reuse jambs so they don't need to get into casing, extension jambs, and exterior trim at all. It allows for a quick, relatively inexpensive job, but smaller windows, as around an inch of space is lost on all sides. It also leaves any existing energy efficiency issues in place, such as air leaks and insulation deficiencies.
So, you decide. If you're willing to rework the siding trim and would prefer to modernize energy efficiency, you'd measure to the framing. If you're keeping the original jambs, measure those. It's also possible that you'd decide on some combination of those based on your trim details.
Sometimes you have to take things apart to come to a conclusion.
Related resource: Window anatomy, by example