When it comes to installing carpet, there are a few things to keep in mind. One of those things is how much room to leave under the baseboard.
Ideally, you want to leave about 1/4 to 1/2 of space between the edge of the carpet and the baseboard. This will allow the carpet to lay flat and not bunch up. It will also allow for some expansion and contraction of the carpet as temperature and humidity levels change.
If you have a thicker carpet, you may need to leave a little more space to avoid the carpet from bulging out at the edges.
In any case, it's always best to err on the side of caution and leave a little more space than you think you need. You can always trim off any excess later on.