You can query the local package database for the size of the package after it is installed:
apt-cache show <package> | grep Installed-Size
This won't include the size of an run-time generated data (e.g., querying for mysql-server-5.5
will return the size of the mysql server application, not including the size of any mysql databases). The information of which files to include in those size calculations would be dependent on the specific version of the specific package, and since that information is not kept in a general database, there's probably not a general solution for calculating it.
Note, if you're getting really small sizes for some packages, make sure you're not looking at an alias (e.g., mysql-client
vs mysql-client-5.5
)