Buy a house when you are sure you will be living in it for an extended time (at least 3 years, preferably at least 5, generally not true this early in your career), you really want to live in a house rather than an apartment(it does consume a chunk of your time and effort that the landlord would deal with in a rental), and you can afford the major up-front investment and long-term ongoing costs (depends on where you are but also rarely true for someone early in their career).
Renting is not always significantly more expensive after everything is figured in. And even if you have the cash on hand to put 20% down on the purchase price, that's going to tie up a major chunk of your net worth in a form you can't easily access.
See past answers re financial priorities. Make sure you have enough readily accessible funds to support yourself for at least 6 months, in case you suddenly find yourself out of work. Make sure you're getting every dollar of the company's contribution to your eventual retirement that you can. After that you can start thinking about investments and houses, probably in that order.
For what it's worth, i'd been out in the working world for 24 years before I bought a house... and then only because i wanted a very specific neighborhood where I expect to spend the rest of my life, and because I wanted some things that don't make sense in an apartment. I grant that this is overkill; many folks do buy houses much sooner... but it certainly isn't something i would recommendbas a top priority for you right now