To share that romantic moment with Bastila in Star Wars: Knights of the Old Republic, you'll first need to complete the "Bastila's Mother" side quest.
After that, keep talking to her and be kind in your responses until the option to kiss her appears.
One important note for PC players: do not continue conversing with her afterward. Doing so triggers a bug that prevents the extra dialogue options on Rakata Prime and the Star Forge from showing up.