Whether and how to thank a girlfriend or boyfriend in the acknowledgements of thesis?

The acknowledgements section is really yours to do with as you wish. You can thank anybody who has been of help and support to you, no matter how formal or informal your relationship with them is. You can make the relationship explicit or not, however you prefer. Thus, for example, it is equally valid to write:

Thank you to Jane Smith, for all her love and support

or

Thank you to my girlfriend Jane Smith, for all her love and support


Adding to jakebeal (and keshlam's comment about offensive text), I think the only negative consequence is when you leave specific people out, e.g., you thank one supervisor but not the other. And that includes people who did support you during your thesis but were not part of the formal structures, e.g., your partner, or your parents, etc. Not to argue with comics, but PhDComics put it best: "Acknowledgements" and "To you I dedicate this thesis".

To avoid forgetting someone, I found it useful to add a general thank you paragraph after the personalized acknowledgements for all those I did not mention explicitly (sums up other colleagues, extended family, etc.).