DPI means dots per inch so the higher the DPI, the bigger the file after scanning. Now I am going to assume we are talking about scanning documents that are mostly text.
Many consumer printers print at 300 to 600 DPI, so a 300 DPI scan is good enough for reproducing a document later. It is also good enough to get good results with OCR. Once you go above 400 DPI, the scanner starts picking up dust and other imperfections on the paper or scanner glass which confuses the OCR engine. After many tests, I have determined that 200 DPI is the lowest acceptable resolution for legibly reproducing documents later, but OCR produces significantly more errors in the text.
Now, if you are talking about scanning photos or fabrics, you may want a higher DPI to capture fine details or texture. For example, I recently scanned my passport at 2400 DPI so I could see the intricate patterns used to detect counterfeiters. (This was for curiosity only.) I have scanned fabrics at 4800 DPI to see how the fibers interact with each other. I have access to a printer that can print at 1200 DPI which significantly improves the clarity of fine details in printed photographs.
In summary, stick with 300 DPI unless you have good, specific reasons to choose something else.