Seconds to years. With enough time and study, identifying minerals becomes very simple, at least for the common stuff. When you start collecting the unusual stuff, then you need to understand crystallography and other important properties, then you get into lab testing, $10-$40 a pop.
Identifying rocks and fossils is much the same, but to actually be able to put a proper name on a rock, or identify the exact species of fossil, you may have to make a thin section and view it under a polarizing microscope, comparing it to known images.
The key to getting good is buying books, so you know exactly what is found in your area, and then just spending thousands of hours actually studying rocks and minerals. Millions of hours of research work has already been done for you, all you have to do is find the right reference.