One of the standard story plot elements since time immemorial. An element of half the movies in existence. A notorious recent example: Titanic.

From that fundamental premise, we may cut to several possible scenarios: Boy loses girl, Boy gets girl back, Boy gets Boy and Tells Girl to Get Lost, whathaveyou. The main thing in formula writing is: it has to look bleak for the protagonist somewhere in the middle.