Although learners have different reasons for learning Mandarin, most people have use for proof of the time they have invested and the proficiency they have achieved. In everyday life situations, it's very rary to be asked proof of one's language abilities (speaking is usually enough), but in some formal contexts, especially education, people simply won't take your word for how much Mandarin you know.
If you're looking for employment, someone already working there might check your language ability directly (and crudely), but in some cases, you won't get so far without a real certificate, it doesn't matter how good your Mandarin is unless you can show that you're a native speaker. Showing which courses you have completed is of little use because they are seldom useful in an international context.
Enter: Standardised proficiency exams
The solution to the above problems is standardised exams. These are set up by authoritative organisations usually tied to governments in some way or another, and their entire reason for being is to assess the language skills of people like you and me.
They are supposed to be competent, impartial and objective. Furthermore, their standards are transparent and easily accessible, meaning that it's possible for outsiders to gague your language ability even though they know little about the exam or Mandarin.
Chinese proficiency exams
There are several proficiency exams for Chinese, but I'm going to talk about two here: HSK, which is the standard in Mainland China, and TOCFL, which is the standard in Taiwan.
Which one you use depends on what you want to use the certificate for. The language tested on the exams is similar (a standardised form of Mandarin), even though there are of course differences.
HSK offers versions in both simlpified and traditional Chinese, whereas TOCFL only offers traditional characters. They both offer test for speaking, listening, reading and writing, although TOCFL has only been standardising the active skills recently. In most cases, though, reading and listening will be enough.
If you live in China or Taiwan, it should be pretty obvious which exam you should take. If you don't, you should think about what you want to use the exam for. If it's for a university application, make sure you check what the school requires. If it's for a job, check what the company wants. In most cases, though, either will do (including a number of other exams I haven't talked about here). You can read more about how to find a test location in the articles about the specific tests.
Additional benefits with taking proficiency tests
Taking a standardised test has other benefits than just giving you proof or your language proficiency. Once you leave the beginner level, progress will seem to slow down. This isn't because you stop learning, it's because each new thing you learn make a smaller difference, relatively speaking. One way of alleviating this problem is to benchmark your skills. If you take a test now and then, you will see proof that you are learning a lot, even if it might not feel like it.
Furthermore, taking a test is in itself a great learning opportunity. Not only do you concentrate fully on the Chinese language for a couple of hours, you also become acutely aware of what you don't know. The first time I took one of these exams, I realised that my passive knowledge of grammar was quite good, but when asked the difference between similar ways of expression, I was lost. In other words, I thought I understood grammar and sentence patterns more than I did. Many learners I have spoken to realise how lousy their listening ability is only after taking a listening comprehension exam which isn't based on their textbook.
Finally, a certain level on a certain exam is a good mid-term study goal (a semester,, a year) if you have few other concrete goals. You know exactly what you have to do and the conditions for succeeding are also clear (you either get the certificate or not).