A patent is a legal right granted by the Patent Office for a new invention. It allows the owner of the patent to take legal action against others who use their invention without permission. The right has a maximum life-time of 20 years in most countries, from the date of the patent application.
A patent does not give you an automatic right to use your invention, and you will still need to take care to avoid infringing other people's rights, and to comply with all relevant legislation. Patents are expensive, and the only valid reasons for maintaining a patent are therefore commercial ones.