How can I know the end of production date for my MacBook Pro? Apple allows to buy original parts for the products 5 years after
the end of production.

What is the end of production date for Early 2015 13" MacBook Pro?

If it is, for example, 10 July 2017. Does it mean that I can buy battery etc. in Apple Store till 10 July 2022 or till 31 December of 2022?
From the Apple Support article, Vintage and obsolete products:


  Vintage and obsolete products
  
  Owners of iPhone, iPad, iPod, or Mac products may obtain service and parts from Apple or Apple service providers for 5 years after the product is no longer manufactured—or longer where required by law. Apple has discontinued support for certain technologically obsolete products.


From the English Wikipedia article on MacBook Pro, the 13" Early 2015 MacBook Pro were succeeded by newer models in Late 2016 (released on October 27, 2016 to be precise). So, you could be potentially looking for a similar timeline (5 years past the date) to receive support from Apple.

The popular Apple product database app MacTracker states that the said model of MacBook Pro were discontinued in June 2017 (exact date not mentioned). So you could be looking for June 2022 timeline for product support.