User-Agent defines the search engine for which you are setting rules bellow. If you put 'User-agent: *' then such rules configured bellow affect all search engine bots. If you for example set 'User-Agent: Googlebot' then rules defined bellow will affect only google bot.
A program that accesses documents on the Web for any purpose. Web browsers, download managers, link checking programs, and indexing robots for search engines are all user agents. " * " means for all of them. It basically means you are calling all of these bots or robots to accept the next set of commands. Let's say, this has been written in robots.txt - User-agent: * Disallow: / The above command means you are restricting access to the root folder of your website for any and all robots.