Under the current patent law “America Invents Act” of 2011, patents are awarded to the first inventor that files for patent protection. This differs from the old law that awarded the patent to the first person or organization that conceived the invention, even if they weren’t the first or only ones to patent it.
It is always best to file a “provisional patent” as soon as you believe your invention is ready. A provisional patent will protect your invention for one year until you file a formal "utility patent". Once you have filed a provisional patent you can discuss your new technology with potential investors or other people and no one will be able to steal your idea or product from you. If you haven’t filed for a utility patent after one year, then your invention can be patented by someone else, even if they weren’t the original inventors. As long as someone has a thorough understanding of how the process or new machine works they can legally file for a patent.
For more information on how to file for a patent consult with an intellectual property lawyer. A lawyer will be able to defend your intellectual property rights and guide you on where, when and how to file for a patent or fight against stolen intellectual property.