Thank for the feedback,
Yes, It is possible to stay until I get the green card because USCIS allowed i-485 applicants to stay until they get that.
Even though I can stay as i-485 pending status, I cannot delay or postpone the military service. So, I have to leave if the green card will not come out within about two months from now.