Form I-140 is the immigrant petition. Form I-485 is the application to adjust status to permanent residence from inside the United States. In eligible employment-based cases, USCIS may allow Form I-485 to be filed with Form I-140 or while that petition is pending.
The timing depends on visa availability under the chart USCIS authorizes for that month and on the remaining filing requirements. Filing the I-140 itself does not establish eligibility to file an I-485.
Check the current Form I-485 instructions and the monthly USCIS filing chart before deciding when to file.