This varies a bit based on company or personal standard operating procedures (SOP's). However, typically a pilot/crew will receive arrival airport information either via D-ATIS (Data Link-Automatic Terminal Information Service) sent directly to an aircraft's on board equipment (e.g., ACARS - Aircraft Communications Addressing and Reporting System), or the same information converted to speech for those aircraft not equipped with an ACARS (or similar receiving system).
The information received generally includes the latest airport weather information, runway(s) in use, type of approach to expect (ILS, Visual, etc.), and any additional relevant information a pilot/crew would need to know before arrival for planning purposes.
For air carrier/high altitude type arrivals the crew generally will access the ATIS prior to the planned "Top of Descent" (TOD) point where the descent from cruise altitude will begin. It would not be uncommon to access the ATIS information 10 minutes (or more) prior to the TOD point (in a relatively lower workload environment) in order for the crew to properly prepare for arrival. This preparation would include accessing the appropriate charts, perhaps inputting information into the onboard navigation/performance computer systems, briefing the approach procedures to be used, missed approach procedures, runway exit procedures, any special instructions noted from the ATIS.
Once the descent began (past the TOD point) and the landing preparations all completed and briefed, it could take 20 - 30 minutes before actual touchdown (or more). This would vary based on ATC requirements, traffic conditions, vectoring, weather, etc.
For light aircraft/low altitude arrivals, the procedure the pilot/crew would take would be fundamentally similar. ATIS information and arrival preparation would (should) be done early enough to allow for the least distraction and done in a relatively low workload environment (prior to a higher - close to the airport - workload environment).
Again, different pilots and company SOP's may call for different procedures, but the above is common in my experience.