I currently use a "Mid 2010" MacBook Pro and was able to install Sierra and XCode 8.3 without any issues.
I would like to use this MBP for some two or three more years, however a person told me that Apple has an "8 year support window" and that 2017 is the last year in which I'll be able to update to the latest OS and install the latest XCode, etc.
I've Googled but couldn't find anything stating a similar policy. Does this have any truth to it? Is it possible to know how much longer I'll be able to install MacOS and XCode updates?
There is no official timeframe that Apple hardware will support the latest operating system or versions of particular software. It will vary depending on the type of enhancements that occur in hardware and what impact this has in terms of what the latest software needs in order to be able to perform certain tasks.
The person who told you that Apple has an "8 year support window" may have been getting confused with Apple's policy on Vintage and obsolete products, but this relates only to hardware/parts support and has no implication in terms of the operating system and other software.
However, even the above will have some exceptions depending on local laws.
Using macOS Sierra as a guide, it is officially supported on:
As you can see, in some cases support goes back to 2009 models, while in others it goes back to 2010 models. Therefore, there is no official timeframe that Apple hardware will support the latest operating system or versions of particular software.