It is absolutely critical that when you apply for a visa you provide the correct and truthful information about your intentions and reasons for applying for the particular visa in question.
You cannot simply make up some reason and apply for a visa of your choice and try and get through the procedure to get it approved, as this can be considered receipt and giving false information to immigration which will most definitely impact all future visa applications.
However, if you give truthful information and receive a visa valid for x months, and then your plans change and you want/need to leave early this is not a problem as long as you follow the correct exit procedure for the visa you have.
The exit procedures can be very different depending on country and type of visa.
A simple Schengen tourist visa for example requires nothing else than simply leaving Schengen, early or not have no bearing on anything else as long as it is done in a normal situation whilst exiting for example China having a work permit and permanent residence card requires an awful lot more with proper conversion to Tourist visa etc before you exit or you will be in a world of hurt the next time you apply for any type of visa for China.