No, there is no such system call, and there really shouldn't be one either. That type of code belongs in user space, not in the kernel.
Linux Syscall Reference
But you can (ab)use mktime in the c(++) standard library. Give it day 0 of a month and it will return the last day of the previous month.
Code:
#include <iostream>
#include <ctime>
int main()
{
int year, month;
std::cout << "Enter year: ";
std::cin >> year;
std::cout << "Enter month: ";
std::cin >> month;
tm dayofmonth= {0};
dayofmonth.tm_year = year - 1900;
dayofmonth.tm_mon = month; // months are 0-11 so this is actually the month following the one we want.
dayofmonth.tm_mday = 0;
mktime(&dayofmonth);
std::cout << year << "/" << month << " has " << dayofmonth.tm_mday << " days" << std::endl;
return 0;
}