It depends on your situation:
If adjusting status within the U.S.: You can apply for an Employment Authorization Document (EAD) by filing Form I-765 concurrently with your adjustment of status application (Form I-485). Processing typically takes 3-5 months. Once approved, you can work for any employer.
Combo card: USCIS now issues combo cards that serve as both an EAD and an Advance Parole (travel) document, eliminating the need for separate applications.
If on a valid work visa: You can continue working under your existing visa (H-1B, L-1, etc.) while your green card application is pending. Your visa status is separate from your pending immigrant petition.
If going through consular processing: You generally cannot work in the U.S. until your immigrant visa is issued and you enter the country as a permanent resident.
Important: Do not begin working without proper authorization. Unauthorized employment can jeopardize your green card application and may result in deportation or bars to future immigration benefits.