生于 is formal/written Chinese. In speech, 出生在 (chūshēng zài) is more common: 我出生在北京 vs. 我生于北京. 生于 appears in biographies, introductions, and classical quotes.
culture
生于忧患,死于安乐 is a famous quote from Mencius (孟子), meaning adversity strengthens while comfort weakens. One of the most quoted classical phrases in Chinese.