whenever shares are issued to pblic as initial public offer - IPO (like Oil India, NHPC, Adani Power, etc, which were recent examples), buying shares through them by applying is called primary market.
if shares are bought from open market at the market rates, they are called bought from secondary market.
Hope the point is understood.
in other words, when we buy shares from the company directly, when they issue the shares, it is called primary issue and when the shares are bought from open market, it is from secondary market