How it is possible for astronomers to find out when the end of the Sun's life will be?
Yes, astronomers could be wrong. Part of being a scientist is always having to be ready to admit that you were wrong.
Astronomers have developed models of how the sun and other stars work. We understand them to be nuclear furnaces. These models may not be perfect, but they are well supported by the evidence and can predict much of what we observe from the sun and other stars. Rob's answer gives some examples of the many tests that these models have passed.
Using these models we can expect the sun to exist for about 10 billion years, and it is currently about 4.6 billion years old. While the model could be wrong, it is probably not very wrong, and the sun will go on shining for a long time yet.
The expected longevity of the Sun is derived from stellar models. Stellar models incorporate all the thermal and nuclear physics we know about how compressed gas at high temperatures will behave. There are multiple points of comparison to test the accuracy of these models using the properties of the present-day Sun - including its luminosity, radius, neutrino losses and helioseismological oscillation spectrum.
There are however some remaining uncertainties that might lead to uncertanties in the lifetime of order $\sim 10$%, but these uncertainties - to do with uncertainties in the initial helium abundance of the Sun, the efficiency of convective heat transport, the potential presence of additional mixing mechanisms and the opacity and composition of the solar interior, can be calibrated out to some extent by matching the properties of the Sun at the known age of the Solar System.
The evidence we have from looking at other star-forming regions and by looking at the relative abundances of the daughter-nuclei of short-lived radioactive nuclei in solar system materials is that the assembly of the Sun and solid material in the Solar System took place on a very short timescale (a few million years) compared with the overall age of the Sun and Solar System.
The age of the Sun (4.58 billion years) is then pinned to the absolute age of the oldest things we can find in the Solar System (ancient meteorites), which are dated through the use of various radioactive decay chains with long half-lives (e.g. lead-lead and uranium-lead dating).
The validity of these tuned solar models is then tested by comparing their predictions against other stars at a range of masses and ages, particularly stars that exist in groups with similar age - i.e. stellar clusters, or stars in (eclipsing) binary systems where the masses, radii and luminosity of the two components can be simultaneously determined.
All these checks and observations lead astronomers to be in no doubt that the Sun will swell up to become a huge red giant in about 7.5 billion years time, where the level of accuracy is likely to be in the second significant figure (e.g. Schroder & Connon-Smith 2008).
To understand stellar evolution (the life cycle of all stars, including our Sun), we start by simply looking at all the stars. We can find out what they are made of and what temperature they are by looking at the spectrum - different elements emit and absorb different wavelengths of light, and the brightness gives us information about temperature. Over hundreds of years, we have then developed models of stars and tried to fit them to explain how many of different types of stars we can see. The models that fit well we keep and refine, the ones that don't fit reality we discard. There are still things we don't understand about stellar structure and evolution, but our Sun is a rather well understood type - it is low to medium mass, and in about the middle of its life. We can't predict to the day or year or hundred years exactly what will happen, but we can predict to around a billion years accuracy when it will run out of hydrogen fuel, swell up to a red giant, and then explode as a supernova and become a white dwarf.