A patent is a time-limited, exclusionary legal right given by a government for an invention. It is given in exchange for disclosing the invention in detail to the public.
Patents typically last for upto 20 years from the earliest filing date (called priority date).
The patent holder can exclude others from a range of actions, including selling, manufacturing, or importing.
Having a patent does not provide a person the right to practice the invention.
Why? The new invention could potentially infringe on an another (earlier) patent, unrelated to the new patent.
Just as there are no world governments, there are no world patents.
Patents are jurisdictional, which means that each patent only covers one geographical region (U.S., China, Australia, etc.).
This also means that each jurisdiction's laws apply, so although patent law tends to be relatively similar across jurisdictions, getting good local advice can be important.
To qualify, it has to be new, not obvious (inventive), and be allowable subject matter.
Examples of non-allowable subject matter include abstract ideas, and in some countries methods of medical treatment (but medical devices are typically allowed).
To apply for a patent, the applicant must disclose enough details of the invention so that the reader could put it into practice after reading. That is the bargain with the society.
In other words, the applicant can't apply for a patent and also hide details relating to the invention.