It doesn't have an "exact" meaning, really. It used to be an insulting term that was used to describe people who had poor social skills and were obsessed with unpopular things like computers or video games, comic books, fantasy or science fiction books, or school subjects like science or math. A "nerd" was usually depicted as an unattractive and socially awkward man who spent most of his time programming computers, playing games, or studying.
Now, the word often has a less negative meaning, maybe because computers, video games, science fiction, etc., aren't usually seen as unpopular or "weird" anymore. People will sometimes describe themselves as "nerds" because they are intensely interested in a particular subject, a certain TV show, or a book series. For example, the Harry Potter series is often perceived as "nerdy" by people who aren't fans. Some Harry Potter fans might be offended by this, but other fans are perfectly happy to consider themselves "Harry Potter nerds," because they're proud of being interested in something that other people think is weird.