I have got a Schengen visa, with:
- Visa from: 28/06/18
- Visa up to: 28/08/18
- Duration of stay: 47 days
I entered the Schengen area on 02/07/18. Up to which date can I stay within the limits of my visa?
You must leave on or before the 17th of August.
If your visa is a multiple-entry visa, or a dual entry visa that you've used only once, you could leave the Schengen area before that, stay away for a number of days, and return until a later date that would depend on how many days you had spent outside the Schengen area. In no case, however, would you be able to stay past the 28th of August.
The calculation works by considering your passport stamps. The date of your entry stamp is your first day of presence, and the date of your exit stamp is the last day of presence. You must also count all the days in between, of course.