The first one, using the word "have", is asking someone if they currently have a boyfriend.
The second one, since it is using "had" (the past tense of have), is asking if someone used to have a boyfriend in the past.
You'll find that native English speakers may mistakenly use both of these phrases interchangeably, so technically they're both "OK". However, I think that you're probably going to want to use the first phrase. Most people, when asking this question, want to know if someone currently has a boyfriend.